丘卡皮


私信TA

用户名:H1810819041

访问量:4087

签 名:

要努力了。

等  级
排  名 656
经  验 3922
参赛次数 4
文章发表 8
年  龄 0
在职情况 学生
学  校 贺州学院
专  业

  自我简介:

解题思路:

注意事项:

参考代码:

#include<stdio.h>

#define n 100

struct student

{

char number[10];

char name[20];

int score1;

int score2;

int score3;

};

int main()

{

struct student a[n];

int m,max,b[n],x=0,y=0,z=0; 

scanf("%d",&m);

for(int i=0;i<m;i++)

{

scanf("%s %s %d %d %d",a[i].name,a[i].number,&a[i].score1,&a[i].score2,&a[i].score3);

x+=a[i].score1;

y+=a[i].score2;

z+=a[i].score3;

}

for(int i=0;i<m;i++)

{

b[i]=a[i].score1+a[i].score2+a[i].score3;

}

int k=0;

for(int i=1;i<m;i++)

{

if(b[i]>b[k])

k=i;

}

printf("%d %d %d",x/m,y/m,z/m);

printf("\n");

printf("%s %s %d %d %d",a[k].name,a[k].number,a[k].score1,a[k].score2,a[k].score3);

return 0;

}


 

0.0分

0 人评分

看不懂代码?想转换其他语言的代码? 或者想问其他问题? 试试问问AI编程助手,随时响应你的问题:

编程语言转换

万能编程问答  

代码解释器

代码纠错

SQL生成与解释

  评论区