1 Star 1 Fork 4

懒羊羊 / Algorithm-note

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
2.11.5.cpp 655 Bytes
一键复制 编辑 原始数据 按行查看 历史
懒羊羊 提交于 2020-01-15 11:01 . C源码
#include <stdio.h>
struct sam{
int num;
char name[10];
int score1;
int score2;
int score3;
};
int main(){
int aver[10],max=0,k=0,i;
sam s[10];
double sco1=0,sco2=0,sco3=0;
for(i=0;i<10;i++){
scanf("%d %s %d %d %d",&s[i].num,s[i].name,&s[i].score1,&s[i].score2,&s[i].score3);
sco1+=s[i].score1;
sco2+=s[i].score2;
sco3+=s[i].score3;
aver[i]= s[i].score1+s[i].score2+s[i].score3;
}
sco1/=10;sco2/=10;sco3/=10;
for(i=0;i<10;i++){
if(aver[i]>max){
max=aver[i];
k=i;
}
}
printf("%.2lf %.2lf %.2lf\n",sco1,sco2,sco3);
printf("%d %s %d %d %d\n",s[k].num,s[k].name,s[k].score1,s[k].score2,s[k].score3);
return 0;
}
C
1
https://gitee.com/yang365/Algorithm-note.git
git@gitee.com:yang365/Algorithm-note.git
yang365
Algorithm-note
Algorithm-note
master

搜索帮助