参考代码:
#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语言代码)浏览:696 |
简单的a+b (C语言代码)浏览:717 |
川哥的吩咐 (C++代码)浏览:1007 |
2006年春浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:467 |
C语言训练-素数问题 (C语言代码)浏览:1653 |
拆分位数 (C语言代码)浏览:1324 |
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:676 |
C语言程序设计教程(第三版)课后习题10.3 (C语言代码)浏览:526 |
DNA (C语言代码)浏览:540 |
C语言程序设计教程(第三版)课后习题9.8 (C语言代码)浏览:664 |