Submission #16320

#TimeUsernameProblemLanguageResultExecution timeMemory
16320tonyjjw속이기 (GA5_fake)C++14
Compilation error
0 ms0 KiB
#include<stdio.h> int N; int main(){ scanf("%d",&N); int sum=0,min=1e9,xor=0; int v; for(int i=0;i<N;i++){ scanf("%d",&v); sum+=v; xor^=v; if(min>v)min=v; } if(xor==0){ printf("%d",sum-min); } else puts("0"); return 0; }

Compilation message (stderr)

fake.cpp: In function ‘int main()’:
fake.cpp:7:21: error: expected unqualified-id before ‘xor’ token
   int sum=0,min=1e9,xor=0;
                     ^
fake.cpp:12:5: error: expected primary-expression before ‘xor’ token
     xor^=v;
     ^
fake.cpp:12:8: error: expected primary-expression before ‘^=’ token
     xor^=v;
        ^
fake.cpp:15:6: error: expected primary-expression before ‘xor’ token
   if(xor==0){
      ^
fake.cpp:15:9: error: expected primary-expression before ‘==’ token
   if(xor==0){
         ^
fake.cpp:6:17: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d",&N);
                 ^
fake.cpp:10:19: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d",&v);
                   ^