foo.cc: In function 'int main()':
foo.cc:37:30: warning: format '%d' expects argument of type 'int', but argument 5 has type 'double' [-Wformat=]
37 | printf("%-8d%-8s%-8c%-8d\n",s[i].num,s[i].name,s[i].sex? 'M':'F',s[i].score);
| ~~~^ ~~~~~~~~~~
| | |
| int double
| %-8f
foo.cc:21:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
21 | { scanf("%d %s %d %f",&s[i].num,s[i].name,&s[i].sex,&s[i].score);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务