Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:18:17: error: 'else' without a previous 'if'
                 else
                 ^~~~
/in/foo.cc:6:24: warning: unused variable 'b' [-Wunused-variable]
         int a[100]={0},b[100]={0};
                        ^
/in/foo.cc:7:13: warning: unused variable 'm' [-Wunused-variable]
   int n,j=0,m=0,i,max;
             ^
/in/foo.cc:7:19: warning: unused variable 'max' [-Wunused-variable]
   int n,j=0,m=0,i,max;
                   ^~~
/in/foo.cc: At global scope:
/in/foo.cc:22:9: error: 'a' does not name a type
         a[j]=n;
         ^
/in/foo.cc:23:5: error: expected unqualified-id before 'for'
     for (int x = 0; x <=j; x++)
     ^~~
/in/foo.cc:23:21: error: 'x' does not name a type
     for (int x = 0; x <=j; x++)
                     ^
/in/foo.cc:23:28: error: 'x' does not name a type
     for (int x = 0; x <=j; x++)
                            ^
/in/foo.cc:37:5: error: 'cout' does not name a type
     cout<<m<<endl;
     ^~~~
/in/foo.cc:38:2: error: expected unqualified-id before 'for'
  for (int i = 0; i < m; i++)
  ^~~
/in/foo.cc:38:18: error: 'i' does not name a type
  for (int i = 0; i < m; i++)
                  ^
/in/foo.cc:38:25: error: 'i' does not name a type
  for (int i = 0; i < m; i++)
                         ^
/in/foo.cc:42:5: error: expected unqualified-id before 'return'
     return 0;
     ^~~~~~
/in/foo.cc:43:5: error: expected declaration before '}' token
     }
     ^

信息

递交者
类型
递交
题目
P1118 找满足条件的素数(3)
语言
C++
递交时间
2021-12-11 13:27:58
评测时间
2021-12-11 13:27:58
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes