十-八进制转换
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; }
相关文章推荐
- 第七节 动手动脑
- HtmlHelper
- *13 Roman to Integer
- Nginx菜鸟入门一
- 关于sizeof和strlen的区别和用法
- 远程关闭服务器命令
- 内部类详解
- 覆盖(override)和重载(overload)
- sleep和wait的区别
- 3D数学基础:图形与游戏开发_读书笔记04
- final----这篇文章是我收获很大
- 软件工程(C编码实践篇)心得体会
- Objective-C中的登录界面判断输入的内容
- 买大米
- android dispatchTouchEvent()事件分发机制
- 第一次用博客
- 链式队列
- 隐藏uitabbar的代码
- 密码管理器
- 104 Maximum Depth of Binary Tree