设为首页 加入收藏

TOP

C经典之12-用链表存1-10的数字---ShinePans
2015-01-22 21:33:52 来源: 作者: 【 】 浏览:74
Tags:经典 12- 1-10 数字 ---ShinePans

\


<??http://www.2cto.com/kf/ware/vc/" target="_blank" class="keylink">vcD4KPHA+PHByZSBjbGFzcz0="brush:java;">#include #include #include //system(); 这个指令需要用到此头文件 #include //toupper要用到 #include //在内存管理时用到的头文件 void main() { int i; struct ListEntry { int number; struct ListEntry *next; } start, *node; start.next = NULL; // Empty list node = &start; // Point to the start of the list for (i = 1; i <= 10; i++) { node->next = (struct ListEntry *) malloc(sizeof(struct ListEntry)); node = node->next; node->number = i; node->next = NULL; } // Display the list node = start.next; while (node) { printf("%d ", node->number); node = node->next; } system("pause"); }

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇C经典之13-Asking的实时监听---Sh.. 下一篇C语言将10进制转为2进制

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: