foo.cc: In function 'int main()':
foo.cc:20:61: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'char (*)[20]' [-Wformat=]
scanf("%d%c%d%f",&s[i].name,s[i].num,&s[i].sex,&s[i].score);
~~~~~~~~~~ ^
foo.cc:20:61: warning: format '%c' expects argument of type 'char*', but argument 3 has type 'int' [-Wformat=]
foo.cc:36:69: warning: format '%d' expects argument of type 'int', but argument 2 has type 'char*' [-Wformat=]
printf("%-8d%-8c%8-d%-8.0f",s[i].name,s[i].num,s[i].sex,s[i].score);
^
foo.cc:36:69: warning: unknown conversion type character '-' in format [-Wformat=]
foo.cc:36:69: warning: format '%f' expects argument of type 'double', but argument 4 has type 'int' [-Wformat=]
foo.cc:36:69: warning: too many arguments for format [-Wformat-extra-args]
foo.cc:20:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%c%d%f",&s[i].name,s[i].num,&s[i].sex,&s[i].score);
~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务