解题思路:
注意事项:
参考代码:
#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 人评分
简单的a+b (C语言代码)浏览:548 |
C语言训练-求素数问题 (C语言代码)浏览:1458 |
A+B for Input-Output Practice (IV) (C++代码)浏览:678 |
简单的a+b (C语言代码)浏览:531 |
程序员的表白 (C语言代码)浏览:667 |
C语言程序设计教程(第三版)课后习题8.1 (C语言代码)浏览:531 |
WU-蓝桥杯算法提高VIP-企业奖金发放 (C++代码)浏览:1176 |
校门外的树 (C语言代码)浏览:702 |
C语言程序设计教程(第三版)课后习题9.8 (C语言代码)浏览:616 |
简单的a+b (C语言代码)浏览:817 |