编写一个函数print(),打印学生的成绩数组,该数组记录每个学生的数据

编写一个函数print(),打印学生的成绩数组,该数组记录每个学生的数据,每个记录包括num,name和score[3... 编写一个函数print(),打印学生的成绩数组,该数组记录每个学生的数据,每个记录包括
num,name和score[3
展开
 我来答
cccchh2011靓丽
2016-12-23 · TA获得超过524个赞
知道小有建树答主
回答量:637
采纳率:14%
帮助的人:126万
展开全部
#include "stdio.h"
#include <stdlib.h>
#define SIZE 50

struct student{
char num[20];
char name[20];
int score[3];
} stud[SIZE];

void print() /* 输出学生的信息 */
{
int i;
printf("\n");
for(i=0;i<SIZE;i++)
printf("%s %s %d %d %d\n",stud[i].num,stud[i].name,stud[i].score[0],stud[i].score[1],stud[i].score[2]);
}

void main()
{
int i;
for(i=0;i<SIZE;i++)
{
printf("第%d个学生的信息:\n",i+1);
scanf("%s%s%d%d%d",stud[i].num,stud[i].name,&stud[i].score[0],&stud[i].score[1],&stud[i].score[2]);
}
print();
}
本回答被网友采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式