/ Vijos /

记录详情

Compile Error

foo.c:4:93: error: expected ':', ',', ';', '}' or '__attribute__' before '=' token
    4 |         char name[20] ;int terminal;int classgrade;char leader;char west;int paper;int money=0;
      |                                                                                             ^
foo.c: In function 'main':
foo.c:12:25: warning: format '%s' expects argument of type 'char *', but argument 2 has type 'char (*)[20]' [-Wformat=]
   12 |                 scanf("%s %d %d %c %c %d\n",&stu[i].name,&stu[i].terminal,&stu[i].classgrade,&stu[i].leader,&stu[i].west,&stu[i].paper);
      |                        ~^                   ~~~~~~~~~~~~
      |                         |                   |
      |                         char *              char (*)[20]
foo.c:14:63: error: 'struct student' has no member named 'money'
   14 |                 if(stu[i].terminal>80&&stu[i].paper>=1){stu[i].money+=8000;}
      |                                                               ^
foo.c:15:68: error: 'struct student' has no member named 'money'
   15 |                 if(stu[i].terminal>85&&stu[i].classgrade>80){stu[i].money+=4000;}
      |                                                                    ^
foo.c:16:46: error: 'struct student' has no member named 'money'
   16 |                 if(stu[i].terminal>90){stu[i].money+=2000;}
      |                                              ^
foo.c:17:64: error: 'struct student' has no member named 'money'
   17 |                 if(stu[i].terminal>85&&stu[i].west=='Y'){stu[i].money+=1000;}//单引号!
      |                                                                ^
foo.c:18:68: error: 'struct student' has no member named 'money'
   18 |                 if(stu[i].classgrade>80&&stu[i].leader=='Y'){stu[i].money+=850;}
      |                                                                    ^
foo.c:22:30: error: 'struct student' has no member named 'money'
   22 |                 total+=stu[i].money;
      |                              ^
foo.c:23:35: error: 'struct student' has no member named 'money'
   23 |                 if(maxmoney<stu[i].money)
      |                                   ^
foo.c:26:40: error: 'struct student' has no member named 'money'
   26 |                         maxmoney=stu[j].money;
      |                                        ^
foo.c:29:51: error: 'struct student' has no member named 'money'
   29 |         printf("%s\n %d\n %d\n",stu[j].name,stu[j].money,total);
      |                                                   ^
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1001 谁拿了最多奖学金
语言
C
递交时间
2022-09-13 18:37:33
评测时间
2022-09-13 18:37:33
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes