解题思路:
注意事项:
参考代码:
#include <iostream>
#include<cstdio>
#include<cstring>
#include<set>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
struct student
{
string name;
int cj1;
int cj2;
char a;
char b;
int t;
};
int main()
{
struct student s[100];
int n, c[100] = {0},tot,sum=0;
cin >> n;
for (int i = 0; i < n; i++)
cin >> s[i].name >> s[i].cj1 >> s[i].cj2 >> s[i].a >> s[i].b >> s[i].t ;
for (int i = 0; i < n; i++)
{
if (s[i].cj1 > 80 && s[i].t >= 1)
c[i] += 8000;
if (s[i].cj1 > 85 && s[i].cj2 > 80)
c[i] += 4000;
if (s[i].cj1 > 90)
c[i] += 2000;
if (s[i].cj1 > 85 && s[i].b=='Y')
c[i] += 1000;
if (s[i].cj2 > 80 && s[i].a == 'Y')
c[i] += 850;
tot = max(tot,c[i]);
sum += c[i];
}
for (int i = 0; i < n; i++)
if (tot == c[i])
{
cout << s[i].name << endl;
cout << tot << endl;
cout << sum << endl;
break;
}
return 0;
}
0.0分
0 人评分
C语言程序设计教程(第三版)课后习题8.7 (C语言代码)浏览:468 |
假币问题 (C语言代码)浏览:2340 |
字符串的输入输出处理 (C语言代码)浏览:671 |
【蟠桃记】 (C语言代码)浏览:2222 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:522 |
C语言程序设计教程(第三版)课后习题10.1 (Java代码)浏览:1447 |
【回文数(二)】 (C语言代码)浏览:732 |
C语言程序设计教程(第三版)课后习题1.5 (C++代码)浏览:1095 |
C语言程序设计教程(第三版)课后习题1.6 (C语言代码)浏览:703 |
C语言程序设计教程(第三版)课后习题9.6 (C语言代码)浏览:373 |