Language: C++

#include<stdio.h>

int main(){
    int n,i,ans=0,xor,sum;
    int a[200000];
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d",&a[i]);
    }

    for(int j=1;j<n;j++){
        xor = sum = a[j-1];
        if(xor == sum){
            ans++;
            printf("xor=%d,sum=%d\n",xor,sum);
        }
        for(i=j;i<n;i++){
            xor = xor ^ a[i];
            sum = sum + a[i];
            if(xor == sum){
                ans++;
            }
            printf("j=%d,i=%d,xor=%d,sum=%d\n",j,i,xor,sum);
        }
    }
    xor = sum = a[n];
    if(xor == sum)
        ans++;
    printf("%d\n",ans);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:19: error: expected unqualified-id before 'xor' token
    4 |     int n,i,ans=0,xor,sum;
      |                   ^~~
a.cc:12:9: error: expected primary-expression before 'xor' token
   12 |         xor = sum = a[j-1];
      |         ^~~
a.cc:12:13: error: expected primary-expression before '=' token
   12 |         xor = sum = a[j-1];
      |             ^
a.cc:12:15: error: 'sum' was not declared in this scope
   12 |         xor = sum = a[j-1];
      |               ^~~
a.cc:13:12: error: expected primary-expression before 'xor' token
   13 |         if(xor == sum){
      |            ^~~
a.cc:13:16: error: expected primary-expression before '==' token
   13 |         if(xor == sum){
      |                ^~
a.cc:15:38: error: expected primary-expression before 'xor' token
   15 |             printf("xor=%d,sum=%d\n",xor,sum);
      |                                      ^~~
a.cc:15:41: error: expected primary-expression before ',' token
   15 |             printf("xor=%d,sum=%d\n",xor,sum);
      |                                         ^
a.cc:18:13: error: expected primary-expression before 'xor' token
   18 |             xor = xor ^ a[i];
      |             ^~~
a.cc:18:17: error: expected primary-expression before '=' token
   18 |             xor = xor ^ a[i];
      |                 ^
a.cc:18:19: error: expected primary-expression before 'xor' token
   18 |             xor = xor ^ a[i];
      |                   ^~~
a.cc:18:23: error: expected primary-expression before '^' token
   18 |             xor = xor ^ a[i];
      |                       ^
a.cc:20:16: error: expected primary-expression before 'xor' token
   20 |             if(xor == sum){
      |                ^~~
a.cc:20:20: error: expected primary-expression before '==' token
   20 |             if(xor == sum){
      |                    ^~
a.cc:23:52: error: expected primary-expression before 'xor' token
   23 |             printf("j=%d,i=%d,xor=%d,sum=%d\n",j,i,xor,sum);
      |                                                    ^~~
a.cc:23:55: error: expected primary-expression before ',' token
   23 |             printf("j=%d,i=%d,xor=%d,sum=%d\n",j,i,xor,sum);
      |                                                       ^
a.cc:26:5: error: expected primary-expression before 'xor' token
   26 |     xor = sum = a[n];
      |     ^~~
a.cc:26:9: error: expected primary-expression before '=' token
   26 |     xor = sum = a[n];
      |         ^
a.cc:26:11: error: 'sum' was not declared in this scope
   26 |     xor = sum = a[n];
      |           ^~~
a.cc:27:8: error: expected primary-expression before 'xor' token
   27 |     if(xor == sum)
      |        ^~~
a.cc:27:12: error: expected primary-expression before '==' token
   27 |     if(xor == sum)
      |            ^~