/ Vijos /

记录详情

Compile Error

/in/foo.c: In function 'main':
/in/foo.c:18:2: error: unknown type name 'Candidate'
  Candidate c[100];
  ^~~~~~~~~
/in/foo.c:18:2: note: use 'struct' keyword to refer to the type
/in/foo.c:24:19: error: request for member 'name' in something not a structure or union
   scanf("%s", c[i].name);
                   ^
/in/foo.c:25:19: error: request for member 'final' in something not a structure or union
   scanf("%d",&c[i].final);
                   ^
/in/foo.c:26:19: error: request for member 'cfinal' in something not a structure or union
   scanf("%d",&c[i].cfinal);
                   ^
/in/foo.c:27:19: error: request for member 'gb' in something not a structure or union
   scanf("%c",&c[i].gb);
                   ^
/in/foo.c:28:19: error: request for member 'west' in something not a structure or union
   scanf("%c",&c[i].west);
                   ^
/in/foo.c:29:19: error: request for member 'paper' in something not a structure or union
   scanf("%d",&c[i].paper);
                   ^
/in/foo.c:34:7: error: request for member 'total' in something not a structure or union
   c[i].total=0;
       ^
/in/foo.c:35:10: error: request for member 'final' in something not a structure or union
   if(c[i].final>80&&c[i].paper>=1)
          ^
/in/foo.c:35:25: error: request for member 'paper' in something not a structure or union
   if(c[i].final>80&&c[i].paper>=1)
                         ^
/in/foo.c:36:8: error: request for member 'total' in something not a structure or union
    c[i].total+=8000;
        ^
/in/foo.c:37:10: error: request for member 'final' in something not a structure or union
   if(c[i].final>85&&c[i].cfinal>80)
          ^
/in/foo.c:37:25: error: request for member 'cfinal' in something not a structure or union
   if(c[i].final>85&&c[i].cfinal>80)
                         ^
/in/foo.c:38:8: error: request for member 'total' in something not a structure or union
    c[i].total+=4000;
        ^
/in/foo.c:39:10: error: request for member 'final' in something not a structure or union
   if(c[i].final>90)
          ^
/in/foo.c:40:8: error: request for member 'total' in something not a structure or union
    c[i].total+=2000;
        ^
/in/foo.c:41:10: error: request for member 'west' in something not a structure or union
   if(c[i].west='Y'&&c[i].final>85)
          ^
/in/foo.c:41:25: error: request for member 'final' in something not a structure or union
   if(c[i].west='Y'&&c[i].final>85)
                         ^
/in/foo.c:42:8: error: request for member 'total' in something not a structure or union
    c[i].total+=1000;
        ^
/in/foo.c:43:10: error: request for member 'gb' in something not a structure or union
   if(c[i].gb='Y'&&c[i].final>85)
          ^
/in/foo.c:43:23: error: request for member 'final' in something not a structure or union
   if(c[i].gb='Y'&&c[i].final>85)
                       ^
/in/foo.c:44:8: error: request for member 'total' in something not a structure or union
    c[i].total+=850;
        ^
/in/foo.c:48:14: error: request for member 'total' in something not a structure or union
  int max=c[0].total;
              ^
/in/foo.c:50:10: error: request for member 'total' in something not a structure or union
   if(c[i].total>max)
          ^
/in/foo.c:51:12: error: request for member 'total' in something not a structure or union
    max=c[i].total;
            ^
/in/foo.c:56:10: error: request for member 'total' in something not a structure or union
   if(c[i].total==max)
          ^
/in/foo.c:64:27: error: request for member 'name' in something not a structure or union
   printf("%s", c[index[i]].name);
                           ^
/in/foo.c:67:27: error: request for member 'total' in something not a structure or union
   printf("%d", c[index[i]].total);
                           ^
/in/foo.c:71:19: error: request for member 'total' in something not a structure or union
   sum+=c[index[i]].total;
                   ^
/in/foo.c:18:12: warning: variable 'c' set but not used [-Wunused-but-set-variable]
  Candidate c[100];
            ^

信息

递交者
类型
递交
题目
P1001 谁拿了最多奖学金
语言
C
递交时间
2018-12-19 20:14:27
评测时间
2018-12-19 20:14:27
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes