| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1112 人关注过本帖, 1 人收藏
标题:关于在c 语言里面的格式输入输出的问题
只看楼主 加入收藏
pretty1984
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2004-6-10
收藏(1)
 问题点数:0 回复次数:1 
关于在c 语言里面的格式输入输出的问题

各位麻烦看看下面的程序,是利用链表输入输出成绩,但是在输入时出现了问题,请帮忙解决 #include <malloc.h> #define NULL 0 #define LEN sizeof(struct student) struct student { int num; int score ; struct student *next;

}; struct student creat (struct student *p) { struct student *p1;

p1=p; printf("please input the number\n"); scanf("%d %d\n",&p->num,&p->score);

if( (p->num)==0) {p->next=NULL; return; } else {p1=(struct student *)malloc(LEN); p->next=p1; creat(p1); } } void print(struct student *p) { if (p->num !=0) printf("num=%d,score=%d\n",p->num,p->score); if (p->next!=NULL) print(p->next); return; }

main() { struct student a; struct student *head;

head=&a; clrscr(); creat(head); printf("the record you input justnow is\n"); print(head); }

搜索更多相关主题的帖子: student 语言 struct FONT 格式 
2004-06-13 23:01
蛤蟆
Rank: 1
等 级:新手上路
帖 子:18
专家分:0
注 册:2004-5-4
收藏
得分:0 
什么样的问题

在暗蓝色的海上,海水在欢快地泼溅。 我们的心是自由的,我们的思想无边。
2004-06-14 02:01
快速回复:关于在c 语言里面的格式输入输出的问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.013523 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved