程序正误

来源:百度知道 编辑:UC知道 时间:2024/06/24 23:47:14
#include<stdio.h>
#include<math.h>
typedef struct node
{int data;
struct node *next;
} Lnode;
void main()
{ int x , a ;
Lnode *p , *front ;
printf("shu ru yao zhuang huan de shu \n");
scanf("%d",&x);
printf("zhuan huan cheng ji jin zhi shu\n ");
scanf("%d",&a);

front=(Lnode*)malloc(sizeof(Lnode));
front->data=(x%a);
x=(x/a);
while(x!=0)
{p=(Lnode*)malloc(sizeof(Lnode));
p->data=(x%a);
x=(x/a);
p->next=front;
front=p;
};
printf("%d",font->data);
printf("\n");
}

意: (上标#)包含< stdio.h》
(上标#)包含< math.h》
typedef淋巴结。>刊于
{智力的数据。
未来;>刊于《节点*,
Lnode } .
无效的主要()。
{智力x,一个.
Lnode前,* * p .
函数的作用是:“蜀俄罗斯姚明壮族欢蜀\ n)德.
(“% d " scanf &x),.
函数的作用是:“》《金直齐国\ n”)。
(“% d " scanf)等。

Lnode *)=(前面Lnode malloc(().
前2 - > x % =(数据)。
x =(x /),
当(0)!
{ p =(Lnode malloc(*)Lnode)(.
警- >数据=(x %).
x =(x /),
p - >下=前面.
前面= p .
} .
函数的作用是:" % d ",字体- >的数据),
函数的作用是:“\ n”),
}