解题思路:
注意事项:注意动态申请数组大小
参考代码:
struct student{ char num[10]; char name[8]; int score[3]; }; void input(struct student *stu) { scanf("%s %s %d %d %d",stu->num,stu->name,&(stu->score[0]),&(stu->score[1]),&(stu->score[2])); } void print(struct student *stu) { printf("%s,%s,%d,%d,%d\n",stu->num,stu->name,stu->score[0],stu->score[1],stu->score[2]); } int main() { int n; scanf("%d",&n); struct student stu[n]; for(int i=0;i<n;i++) { input(&stu[i]); } for(int i=0;i<n;i++) { print(&stu[i]); } }
0.0分
7 人评分
C语言程序设计教程(第三版)课后习题3.7 (C语言代码)浏览:732 |
C语言程序设计教程(第三版)课后习题10.7 (C语言代码)浏览:968 |
妹子杀手的故事 (C语言代码)浏览:1232 |
C语言程序设计教程(第三版)课后习题5.7 (Java代码)浏览:889 |
wu-淘淘的名单 (C++代码)浏览:1339 |
Cylinder (C语言描述,蓝桥杯)浏览:1247 |
1013题解浏览:560 |
C语言程序设计教程(第三版)课后习题9.6 (C语言代码)浏览:587 |
A+B for Input-Output Practice (IV) (C语言代码)浏览:470 |
哥德巴赫曾猜测 (C++代码)浏览:740 |