日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

c语言创建学生成绩表,C语言创建信息链表,求助

發(fā)布時間:2024/2/28 编程问答 42 豆豆
生活随笔 收集整理的這篇文章主要介紹了 c语言创建学生成绩表,C语言创建信息链表,求助 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

我想創(chuàng)建一個學生信息成績冊,程序如下,能輸入,但顯示不出來,怎么回事啊?求助

#include

#include

#define NULL 0

#define LEN sizeof(struc

我想創(chuàng)建一個學生信息成績冊,程序如下,能輸入,但顯示不出來,怎么回事啊?求助

#include

#include

#define NULL 0

#define LEN sizeof(struct student)

struct student

{

long stu_num;

char stu_name;

float stu_score;

struct student *next;

};

int n;

void main()

{

struct student *creat(void);

struct student *ty;

printf("\nPlease input the student information:");

printf("\nas the order of student number:\n");

ty=creat();

printf("\nNow,These records are:\n");

if(ty!=NULL)

do

{printf("%ld %s %5.1f\n",ty->stu_num,ty->stu_name,ty->stu_score);

ty=ty->next;

}while(ty!=NULL);

}

struct student *creat(void)

{

struct student *head;

struct student *t1,*t2;

n=0;

t1=t2=(struct student*)malloc(LEN);

scanf("%ld,%s,%f",&t1->stu_num,&t1->stu_name,&t1->stu_score);

head=NULL;

while(t1->stu_num!=0)

{

n=n+1;

if(n==1)head=t1;

else t2->next=t1;

t2=t1;

t1=(struct student*)malloc(LEN);

scanf("%ld,%s,%f",&t1->stu_num,&t1->stu_name,&t1->stu_score);

}

t2->next=NULL;

return(head);

}

展開

全部

總結

以上是生活随笔為你收集整理的c语言创建学生成绩表,C语言创建信息链表,求助的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。