foo.cc: In function 'int main()':
foo.cc:9:25: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'std::string*' {aka 'std::__cxx11::basic_string<char>*'} [-Wformat=]
9 | scanf("%d%d%d%d%d%d", &name, &s1, &s2, &a, &b, &x);
| ~^ ~~~~~
| | |
| int* std::string* {aka std::__cxx11::basic_string<char>*}
foo.cc:9:31: warning: format '%d' expects argument of type 'int*', but argument 5 has type 'char*' [-Wformat=]
9 | scanf("%d%d%d%d%d%d", &name, &s1, &s2, &a, &b, &x);
| ~^ ~~
| | |
| int* char*
| %hhd
foo.cc:9:33: warning: format '%d' expects argument of type 'int*', but argument 6 has type 'char*' [-Wformat=]
9 | scanf("%d%d%d%d%d%d", &name, &s1, &s2, &a, &b, &x);
| ~^ ~~
| | |
| int* char*
| %hhd
foo.cc:11:31: error: 'score2' was not declared in this scope
11 | if(s1 > 85 && score2 > 80) sum += 4000;
| ^~~~~~
foo.cc:16:26: error: 'maxx' was not declared in this scope; did you mean 'maxn'?
16 | if(sum > maxx) maxn = name, maxx = sum; sum = 0;
| ^~~~
| maxn
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;
| ^~~
foo.cc:18:38: error: 'maxx' was not declared in this scope; did you mean 'maxn'?
18 | printf("%d\n%d\n%d\n", maxn, maxx, tot);
| ^~~~
| maxn
foo.cc:4:33: warning: unused variable 'max' [-Wunused-variable]
4 | int n, s1, s2, sum = 0, max = 0, tot = 0, x;
| ^~~
[Hydro](https://hydro.ac)提供评测服务