#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;
}
十-八進制轉換
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.