解题思路:结构体
注意事项:
参考代码:
#include<stdio.h>
struct student
{
char id[20];
char name[20];
int score1;
int score2;
int score3;
};
int main()
{
struct student stu[1003];
int n;
int i;
scanf("%d",&n);
getchar();
for(i = 0;i<n;i++)
{
scanf("%s",stu[i].id);
getchar();
scanf("%s",stu[i].name);
scanf("%d %d %d",&stu[i].score1,&stu[i].score2,&stu[i].score3);
getchar();
}
for(i = 0;i<n;i++)
{
printf("%s,",stu[i].id);
printf("%s,",stu[i].name);
printf("%d,%d,%d\n",stu[i].score1,stu[i].score2,stu[i].score3);
}
return 0;
}
0.0分
0 人评分
C语言训练-求具有abcd=(ab+cd)2性质的四位数 (C语言代码)浏览:1367 |
C语言程序设计教程(第三版)课后习题12.6 (C语言代码)浏览:791 |
C语言程序设计教程(第三版)课后习题6.10 (C语言代码)浏览:879 |
1054题解浏览:460 |
1231题解(注意理解“输入多个测试实例”)浏览:785 |
生日日数 (C语言代码)浏览:1497 |
简单的a+b (C语言代码)浏览:434 |
C语言程序设计教程(第三版)课后习题6.5 (C语言代码)浏览:485 |
小O的数字 (C++代码)浏览:757 |
C语言程序设计教程(第三版)课后习题3.7 (C语言代码)浏览:728 |