记录详情

Compile Error

foo.c:4:21: error: expected ']' before ';' token
 #define MaxSize 1000;
                     ^
foo.c:8:11: note: in expansion of macro 'MaxSize'
  int data[MaxSize];
           ^
foo.c:9:1: warning: no semicolon at end of struct or union
 }Stack;
 ^
foo.c: In function 'main':
foo.c:4:21: error: expected ']' before ';' token
 #define MaxSize 1000;
                     ^
foo.c:17:20: note: in expansion of macro 'MaxSize'
     char sentences[MaxSize];
                    ^
foo.c:18:13: error: 'sentences' undeclared (first use in this function)
  scanf("%s",sentences);
             ^
foo.c:18:13: note: each undeclared identifier is reported only once for each function it appears in
foo.c:20:16: warning: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
  for(int i=0;i<strlen(sentences);i++)
                ^
foo.c:20:16: warning: incompatible implicit declaration of built-in function 'strlen'
foo.c:20:16: note: include '<string.h>' or provide a declaration of 'strlen'
foo.c:25:5: error: 'Stack {aka struct <anonymous>}' has no member named 'data'
    p->data[i]=i;
     ^
foo.c:29:7: error: 't' undeclared (first use in this function)
    if(t->top==-1)//栈内没有左括号,right情况
       ^
foo.c:43:18: error: 'Stack {aka struct <anonymous>}' has no member named 'data'
    printf(" %d",p->data[p->top--];
                  ^
foo.c:43:34: error: expected ')' before ';' token
    printf(" %d",p->data[p->top--];
                                  ^
foo.c:44:3: error: expected ';' before '}' token
   }
   ^
foo.c:48:1: error: expected declaration or statement at end of input
 }
 ^

自豪的采用 HydroJudger 进行评测(github.com/hydro-dev/HydroJudger)

信息

递交者
类型
递交
题目
DS2-1 括号的匹配
语言
C
递交时间
2020-04-10 10:59:09
评测时间
2020-04-10 10:59:09
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes