您的位置:首页 > 其它

十-八进制转换

2015-11-14 20:08 190 查看
#include<stdio.h>
#include <stdlib.h>
typedef struct node
{
int data;
struct node *next;
}node;
int main()
{
int m,n;
node *p,*q,*top;
top=(struct node *)malloc(sizeof(struct node));
top->next=NULL;
scanf("%d",&m);
while(m!=0)
{
p=(struct node *)malloc(sizeof(struct node));
n=m%8;
p->data=n;
p->next=top->next;
top->next=p;
m=m/8;

}
while(top->next!=NULL)
{
top=top->next;
printf("%d",top->data);
}
printf("\n");
return 0;

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: