Language: C++

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define rep2(i,n) for(int i=0;i<=n;i++)
#define repr(i,a,n) for(int i=a;i<n;i++)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
#define INF 1e10
#define MOD 1e9+7
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
signed main()
  int a;
  cin>>a;
  vector<int> b;
  rep(i,a)
  cin>>b[i];
  int c[a+1];
  c[0]=0;
  rep1(i,a)
    c[i]=b[i-1]+c[i-1];
  int d=0;
  rep(i,a+1)rep(j,a+1){
  if(c[i]==c[j])
    d++;
  }
cout<<d/2<<endl;
}

Compiler output:
a.cc:3:13: error: expected initializer before 'long'
    3 | #define int long long
      |             ^~~~
a.cc:16:3: note: in expansion of macro 'int'
   16 |   int a;
      |   ^~~
a.cc:17:3: error: 'cin' does not name a type
   17 |   cin>>a;
      |   ^~~
a.cc:4:18: error: expected unqualified-id before 'for'
    4 | #define rep(i,n) for(int i=0;i<n;i++)
      |                  ^~~
a.cc:19:3: note: in expansion of macro 'rep'
   19 |   rep(i,a)
      |   ^~~
a.cc:19:7: error: 'i' does not name a type
   19 |   rep(i,a)
      |       ^
a.cc:4:30: note: in definition of macro 'rep'
    4 | #define rep(i,n) for(int i=0;i<n;i++)
      |                              ^
a.cc:19:7: error: 'i' does not name a type
   19 |   rep(i,a)
      |       ^
a.cc:4:34: note: in definition of macro 'rep'
    4 | #define rep(i,n) for(int i=0;i<n;i++)
      |                                  ^
a.cc:21:9: error: 'a' was not declared in this scope
   21 |   int c[a+1];
      |         ^
a.cc:22:3: error: 'c' does not name a type
   22 |   c[0]=0;
      |   ^
a.cc:5:19: error: expected unqualified-id before 'for'
    5 | #define rep1(i,n) for(int i=1;i<=n;i++)
      |                   ^~~
a.cc:23:3: note: in expansion of macro 'rep1'
   23 |   rep1(i,a)
      |   ^~~~
a.cc:23:8: error: 'i' does not name a type
   23 |   rep1(i,a)
      |        ^
a.cc:5:31: note: in definition of macro 'rep1'
    5 | #define rep1(i,n) for(int i=1;i<=n;i++)
      |                               ^
a.cc:23:8: error: 'i' does not name a type
   23 |   rep1(i,a)
      |        ^
a.cc:5:36: note: in definition of macro 'rep1'
    5 | #define rep1(i,n) for(int i=1;i<=n;i++)
      |                                    ^
a.cc:4:18: error: expected unqualified-id before 'for'
    4 | #define rep(i,n) for(int i=0;i<n;i++)
      |                  ^~~
a.cc:26:3: note: in expansion of macro 'rep'
   26 |   rep(i,a+1)rep(j,a+1){
      |   ^~~
a.cc:26:7: error: 'i' does not name a type
   26 |   rep(i,a+1)rep(j,a+1){
      |       ^
a.cc:4:30: note: in definition of macro 'rep'
    4 | #define rep(i,n) for(int i=0;i<n;i++)
      |                              ^
a.cc:26:7: error: 'i' does not name a type
   26 |   rep(i,a+1)rep(j,a+1){
      |       ^
a.cc:4:34: note: in definition of macro 'rep'
    4 | #define rep(i,n) for(int i=0;i<n;i++)
      |                                  ^
a.cc:26:17: error: 'j' does not name a type
   26 |   rep(i,a+1)rep(j,a+1){
      |                 ^
a.cc:4:30: note: in definition of macro 'rep'
    4 | #define rep(i,n) for(int i=0;i<n;i++)
      |                              ^
a.cc:26:17: error: 'j' does not name a type
   26 |   rep(i,a+1)rep(j,a+1){
      |                 ^
a.cc:4:34: note: in definition of macro 'rep'
    4 | #define rep(i,n) for(int i=0;i<n;i++)
      |                                  ^
a.cc:30:1: error: 'cout' does not name a type
   30 | cout<<d/2<<endl;
      | ^~~~
a.cc:31:1: error: expected declaration before '}' token
   31 | }
      | ^