/ JoyAc /

记录详情

Compile Error

/in/foo.c:10:9: error: expected ':', ',', ';', '}' or '__attribute__' before '=' token
  int all=0;
         ^
/in/foo.c: In function 'main':
/in/foo.c:17:6: error: 'student {aka struct stu}' has no member named 'all'
  flag.all=0;
      ^
/in/foo.c:20:57: error: expected expression before 'student'
   scanf("%s %d %d %c %c %d",&stu.name,&stu.avg,&stu.vi,&student.ganbu,&stu.xibu,&stu.lenwen);
                                                         ^~~~~~~
/in/foo.c:22:10: error: 'student {aka struct stu}' has no member named 'lenwen'; did you mean 'lunwen'?
    if(stu.lenwen>=1)
          ^
/in/foo.c:23:8: error: 'student {aka struct stu}' has no member named 'all'
     stu.all+=8000;
        ^
/in/foo.c:25:8: error: 'student {aka struct stu}' has no member named 'all'
     stu.all+=850;
        ^
/in/foo.c:28:7: error: 'vi' undeclared (first use in this function)
    if(vi>80)
       ^~
/in/foo.c:28:7: note: each undeclared identifier is reported only once for each function it appears in
/in/foo.c:29:8: error: 'student {aka struct stu}' has no member named 'all'
     stu.all+=4000;
        ^
/in/foo.c:31:8: error: 'student {aka struct stu}' has no member named 'all'
     stu.all+=1000;
        ^
/in/foo.c:34:7: error: 'student {aka struct stu}' has no member named 'all'
    stu.all+=2000;
       ^
/in/foo.c:36:11: error: 'student {aka struct stu}' has no member named 'all'
   sum+=stu.all;
           ^
/in/foo.c:37:9: error: 'student {aka struct stu}' has no member named 'all'
   if(stu.all>flag.all){
         ^
/in/foo.c:37:18: error: 'student {aka struct stu}' has no member named 'all'
   if(stu.all>flag.all){
                  ^
/in/foo.c:41:34: error: 'student {aka struct stu}' has no member named 'all'
  printf("%s\n%d\n%d",stu.name,stu.all,sum);
                                  ^
/in/foo.c:16:14: warning: variable 'flag' set but not used [-Wunused-but-set-variable]
  student stu,flag;
              ^~~~

信息

递交者
类型
递交
题目
P1001 谁拿了最多奖学金
语言
C
递交时间
2021-12-04 22:26:01
评测时间
2021-12-04 22:26:01
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes