student_input.c
来自「c语言版的学生成绩管理系统」· C语言 代码 · 共 29 行
C
29 行
student * input(){ student *head; student *p1; student *p2; char flag; flag='y'; head=p1=p2=(student *)malloc(sizeof(student)); while(p2->NO !=0&&flag=='y'){ p1->next=p2; printf("please enter student NO.\n"); scanf("%d",&p2->no); printf("please enter student name\n"); scanf("%s",p2->name); printf("please enter the English score\n"); scanf("%d",&p2->english); printf("please enter the Chinese score\n"); scanf("%d",&p2->chinese); printf("please enter the Macth score\n"); scanf("%d",&p2->macth); printf("a student enter over ,do continue ? y/n\n"); flag=getchar(); p1=p2; p2=(student *)malloc(sizeof(student)); } p1->next=NULL; free(p2); return head;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?