解题思路:
注意事项:
参考代码:
#include <stdio.h>
struct stu
{
char num[100];
char name[100];
int score[3];
};
void input(struct stu* a,int n);
void output(struct stu* a,int n);
int main(void)
{
int n;
scanf("%d",&n);
struct stu a[n];
input(a,n);
output(a,n);
return 0;
}
void input(struct stu * a,int n)
{
int i;
for(i=0;i<n;i++)
{
scanf("%s%s%d%d%d",&(a[i].num),&(a[i].name),&(a[i].score[0]),&(a[i].score[1]),&(a[i].score[2]));
}
}
void output(struct stu* a,int n)
{
int i;
for(i=0;i<n;i++)
{
printf("%s,%s,%d,%d,%d\n",a[i].num,a[i].name,a[i].score[0],a[i].score[1],a[i].score[2]);
}
}
0.0分
0 人评分
假币问题 (C++代码)(向上取整的一种处理方式)浏览:1660 |
点我有惊喜!你懂得!浏览:2071 |
Hello, world! (C语言代码)浏览:1198 |
C语言训练-计算一个整数N的阶乘 (C语言代码)浏览:928 |
人见人爱A+B (C语言代码)浏览:626 |
C语言程序设计教程(第三版)课后习题6.11 (C语言代码)浏览:2080 |
Wu-求圆的面积 (C++代码)浏览:1883 |
2006年春浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:464 |
C语言程序设计教程(第三版)课后习题6.9 (C语言代码)浏览:628 |
C语言训练-数字母 (C语言代码)浏览:601 |