成绩处理
来源:互联网 发布:云南触动网络 编辑:程序博客网 时间:2024/04/30 04:18
/* *Copyright (c)2016,烟台大学计算机与控制工程学院 *All rights reserved. *文件名称:main.cpp *作 者:王艺霖 *完成日期:2016年3月29日 *版 本 号:v1.0 *问题描述: 成绩处理 */ #include <stdio.h> struct student { char num[20]; char name[20]; int chengji1; int chengji2; int chengji3; }; int main() { int n,i,sum1=0,sum2=0,sum3=0; scanf("%d",&n); struct student stu[n]; struct student max; for(i=0;i<n;i++) { scanf("%s%s%d%d%d",stu[i].num,stu[i].name,&stu[i].chengji1,&stu[i].chengji2,&stu[i].chengji3); } max=stu[0]; for(i=0;i<n;i++) { sum1+=stu[i].chengji1; sum2+=stu[i].chengji2; sum3+=stu[i].chengji3; if(stu[i].chengji1>max.chengji1&&stu[i].chengji2>max.chengji2&&stu[i].chengji3>max.chengji3) max=stu[i]; } printf("%d %d %d\n",sum1/n,sum2/n,sum3/n); printf("%s %s %d %d %d",max.num,max.name,max.chengji1,max.chengji2,max.chengji3); return 0; }
0 0
- 成绩处理
- 成绩处理
- 成绩处理
- 成绩处理
- 成绩处理
- 成绩处理
- 成绩处理
- 成绩处理
- 成绩处理
- 成绩处理
- 成绩处理。
- 成绩处理
- 成绩处理
- 成绩处理
- 成绩处理
- 成绩处理
- 成绩处理
- 成绩处理
- 2Strange fuction
- 第三周项目二
- 求n的阶乘
- hdu2222ac自动机入门
- Educational Codeforces Round 10 C. Foe Pairs
- 成绩处理
- yii2一次插入多行数据
- 深入理解php内核
- Android 天气预报
- linux 递归生成两个目录的diff
- 项目16-时间类(2)
- JackJsonUtils工具类
- 第五周上机实践项目 项目1--三角形类雏形(2)
- Communication Patterns