Accepted
foo.cc: In function 'int main()': foo.cc:16:17: warning: this 'if' clause does not guard... [-Wmisleading-indentation] 16 | if(sum > maxx) maxn = name, maxx = sum; sum = 0; | ^~ foo.cc:16:57: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if' 16 | if(sum > maxx) maxn = name, maxx = sum; sum = 0; | ^~~
[Hydro](https://hydro.ac)提供评测服务
代码
#include<bits/stdc++.h>
using namespace std;
int main() {
int n, s1, s2, sum = 0, maxx = 0, tots = 0, x;
char a, b;
string name, maxn;
scanf("%d", &n);
for(int i = 1; i <= n; i++) {
cin >> name >> s1 >> s2 >> a >> b >> x;
if(s1 > 80 && x > 0) sum += 8000;
if(s1 > 85 && s2 > 80) sum += 4000;
if(s1 > 90) sum += 2000;
if(s1 > 85 && b == 'Y') sum += 1000;
if(s2 > 80 && a == 'Y') sum += 850;
tots += sum;
if(sum > maxx) maxn = name, maxx = sum; sum = 0;
}
printf("%s\n%d\n%d\n", maxn.c_str(), maxx, tots);
return 0;
}
信息
- 递交者
- 类型
- 递交
- 题目
- P1000 谁拿了最多奖学金
- 题目数据
- 下载
- 语言
- C++
- 递交时间
- 2020-11-06 20:22:17
- 评测时间
- 2023-09-05 13:30:22
- 评测机
- 分数
- 100
- 总耗时
- 43ms
- 峰值内存
- 412.0 KiB