-
大小: 601B文件類型: .zip金幣: 2下載: 0 次發布日期: 2021-06-05
- 語言: C/C++
- 標簽:
資源簡介
《C語言程序設計實驗指導》(顏暉,張泳主編)102頁答案

代碼片段和文件信息
#include
#include
#include
struct?stud_node{
int?num;
char?name[20];
int?score;
struct?stud_node?*?next;
};
int?main(void)
{
struct?stud_node?*?head*?tail*?p;
int?numscore;
char?name[20];
int?size?=?sizeof(struct?stud_node);
head?=?tail?=?NULL;
printf(“Input?numname?and?score:\n“);
scanf(“%d“&num);
while(num?!=?0){
p?=?(struct?stud_node?*)malloc(size);
scanf(“%s%d“name&score);
p?->?num?=?num;
strcpy(p?->?namename);
p?->?score?=?score;
p?->?next?=?NULL;
tail?->?next?=?p;
tail?=?p;
scanf(“%d“&num);
}
for(p?=?head;p?->?next?!=?NULL;p?=?p?->?next)
printf(“%d%d%d\n“p?->?nump?->?namep?->?score);
return?0;
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2011-12-21?08:58??102\
?????文件?????????718??2011-12-19?22:48??102\1.cpp
- 上一篇:倉庫管理系統 vc++
- 下一篇:MFC 計算器源代碼
評論
共有 條評論