解题思路:
注意事项:
参考代码:
#include<stdio.h> struct student { char sno[20]; char sname[20]; int cj1; int cj2; int cj3; }; void input(struct student st[],int n) { int i; for(i = 0; i < n; i++){ scanf("%s%s%d%d%d",&st[i].sno,&st[i].sname,&st[i].cj1,&st[i].cj2,&st[i].cj3); } } void print(struct student st[],int n) { int i; for(i = 0; i < n; i++){ printf("%s,%s,%d,%d,%d\n",st[i].sno,st[i].sname,st[i].cj1,st[i].cj2,st[i].cj3); } } int main() { int N; struct student st[100]; scanf("%d",&N); input(st,N); print(st,N); return 0; }
0.0分
0 人评分
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:677 |
sizeof的大作用 (C语言代码)浏览:1450 |
简单的a+b (C语言代码)浏览:419 |
1071题解浏览:493 |
2003年秋浙江省计算机等级考试二级C 编程题(1) (C语言代码)浏览:518 |
简单的事情 (C语言代码)浏览:638 |
C语言程序设计教程(第三版)课后习题8.1 (C语言代码)浏览:566 |
众数问题 (C语言代码)浏览:673 |
1392题解(大数相加)浏览:604 |
C语言程序设计教程(第三版)课后习题7.3 (C语言代码)浏览:576 |