运行 ID: 47683

Main.cc: In function ‘int main()’:
Main.cc:6:20: warning: unused variable ‘j’ [-Wunused-variable]
     int a,b[110],i,j,k,q;
                    ^
Main.cc:6:22: warning: unused variable ‘k’ [-Wunused-variable]
     int a,b[110],i,j,k,q;
                      ^
Main.cc: At global scope:
Main.cc:20:9: error: expected unqualified-id before ‘if’
         if(!n) break;
         ^~
Main.cc:21:9: error: ‘sum’ does not name a type
         sum = 0;
         ^~~
Main.cc:22:9: error: expected unqualified-id before ‘for’
         for(int i = 1; i <= n; i ++) {
         ^~~
Main.cc:22:24: error: ‘i’ does not name a type
         for(int i = 1; i <= n; i ++) {
                        ^
Main.cc:22:32: error: ‘i’ does not name a type
         for(int i = 1; i <= n; i ++) {
                                ^
Main.cc:27:13: error: expected constructor, destructor, or type conversion before ‘(’ token
         sort(a + 1, a + 1 + N);
             ^
Main.cc:28:9: error: expected unqualified-id before ‘for’
         for(int i = 1; i <= n / 2 + 1; i ++)
         ^~~
Main.cc:28:24: error: ‘i’ does not name a type
         for(int i = 1; i <= n / 2 + 1; i ++)
                        ^
Main.cc:28:40: error: ‘i’ does not name a type
         for(int i = 1; i <= n / 2 + 1; i ++)
                                        ^
Main.cc:30:15: error: expected constructor, destructor, or type conversion before ‘(’ token
         printf("%d\n", sum);
               ^
Main.cc:31:5: error: expected declaration before ‘}’ token
     }
     ^
Main.cc: In function ‘int main()’:
Main.cc:7:25: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     while(scanf("%d",&a),a!=0)
           ~~~~~~~~~~~~~~^~~~~
Main.cc:11:18: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
             scanf("%d",&b[i]);
             ~~~~~^~~~~~~~~~~~