解题思路:
注意事项:
参考代码:
#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++代码)浏览:1326 |
C语言程序设计教程(第三版)课后习题6.9 (C语言代码)浏览:532 |
WU-C语言程序设计教程(第三版)课后习题11.12 (C++代码)(想学链表的小伙伴可以看看)浏览:898 |
C语言程序设计教程(第三版)课后习题6.9 (C语言代码)浏览:624 |
DNA (C语言代码)浏览:540 |
数组与指针的问题浏览:716 |
C语言训练-8除不尽的数 (C语言代码)浏览:1396 |
C语言程序设计教程(第三版)课后习题8.9 (C语言代码)浏览:498 |
C语言程序设计教程(第三版)课后习题8.3 (C语言代码)浏览:382 |
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:676 |