参考代码:
#include <stdio.h>
#include <stdlib.h>
struct student{
char id[20];
char name[20];
int a;
int b;
int c;
};
void input(struct student *p){
scanf("%s%s%d%d%d",p->id,p->name,&p->a,&p->b,&p->c);
}
void output(struct student *p){
printf("%s,%s,%d,%d,%d\n",p->id,p->name,p->a,p->b,p->c);
}
int main()
{
// cout << "Hello world!" << endl;
struct student buf[50],*p;
int n;
scanf("%d",&n);
for(p=buf;p<buf+n;p++){
input(p);
}
for(p=buf;p<buf+n;p++){
output(p);
}
return 0;
}
0.0分
0 人评分
开心的金明 (C++代码)浏览:1188 |
C二级辅导-同因查找 (C++代码)(42的倍数,,所以直接递加42输出)浏览:1092 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:632 |
数列 (C++代码)浏览:664 |
C语言训练-求矩阵的两对角线上的元素之和 (C语言代码)浏览:3392 |
上车人数 (C语言代码)浏览:777 |
C语言程序设计教程(第三版)课后习题8.3 (C语言代码)浏览:702 |
大神老白 (C语言代码)浏览:640 |
WU-判定字符位置 (C++代码)浏览:1395 |
C语言程序设计教程(第三版)课后习题9.2 (C语言代码)浏览:556 |