criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
 int N;
 int i;
 cin >> N;
 int a[N];
 long long int odd=0;
 for(i=0;i<N;i++)cin >> a[i];
 for(i=0;i<(N-1)/2;i++){
   odd += a[2*i];
   odd -= a[2*i+1];
 }
 odd += a[N-1];
 for(i=0;i<(N-1)/2;i++){
   cout << odd << " " << 2*a[2*i]-odd; << " ";
   odd -= a[2*i];
   odd += a[2*i+1];
   }
 cout << odd << endl;
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:17:40: error: expected primary-expression before '<<' token
   17 |    cout << odd << " " << 2*a[2*i]-odd; << " ";
      |                                        ^~
Language: C++

 #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <cassert>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <unordered_set>
#include <iomanip>
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<ll> > vvll;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define irep(it, stl) for(auto it = stl.begin(); it != stl.end(); it++)
#define drep(i,n) for(int i = (n) - 1; i >= 0; --i)
#define fin(ans) cout << (ans) << endl
#define mp(p,q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define Rort(a) sort(a.rbegin(), a.rend())
#define MATHPI acos(-1)
int dx8[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy8[8] = {0, 1, 0, -1, 1, 1, -1, -1};
int dx4[4] = {1, 0, -1, 0};
int dy4[4] = {0, 1, 0, -1};
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;}
template<typename A, size_t N, typename T> void Fill(A (&array)[N], const T &val){ fill((T*)array, (T*)(array+N), val); }
struct io{io(){ios::sync_with_stdio(false);cin.tie(0);}};
const int INF = INT_MAX;
const ll LLINF = 1LL<<60;
const ll MOD = 1000000007;
const double EPS = 1e-9;
template < typename T > inline string toString( const T &a ) { ostringstream oss; oss << a; return oss.str(); };


int main()
{
  int N;
  cin >> N;
  vi a(N);
  rep(i,N) cin >> a[i];

  vi ans;
  int nextX=0;
  //例えばx1,x2,x3があるとすると、x1=A1-x2、x2=A2-x1でx1=(A1-A2)/2,x1とx2を解き、そこからx3以降を解いていく,N>=3なのでx1,x2は必ず存在する
  int x1 = (a[i] - a[i+1])/2;
  ans.push_back(x1);
  int x2 = a[i+1]-x1;
  ans.push_back(x2);
  nextX = x2;

  for(int i=2;i<=N-1;i++){
     nextX = a[i] - nextX;
     ans.push_back(nextX);
  }

  rep(i,ans.size()){
      cout << ans[i] << " ";
  }

  cout << endl;

}



Compiler output:
a.cc: In function 'int main()':
a.cc:72:15: error: 'i' was not declared in this scope
   72 |   int x1 = (a[i] - a[i+1])/2;
      |               ^
Language: C++

n = int(input())
a = list(map(int,input().split()))

l = [0]
for i in range(1,len(a)):
    l.append(a[i - 1] * 2 - l[i - 1])
dam = [sum(a) - sum(l)]

for i in a[:-1]:
    dam.append((i - dam[-1] // 2) * 2)
print(*dam)

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^
Language: C++

#include <iostream>
#include <cmath>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define ll long long


int main() {
  ll n,s,x;
  ll* a;
  
  cin >> n;
  a = new int[n];
  rep(i,n) cin >> a[i];

  rep(i,n) {
    s=1; x=0;
    rep(j,n) {
      x += s*a[(i+j)%n];
      s *= -1;
    }
    cout << x << " ";
  }
  cout << endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:7: error: cannot convert 'int*' to 'long long int*' in assignment
   13 |   a = new int[n];
      |       ^~~~~~~~~~
      |       |
      |       int*
Language: Java

import java.util.*;
import java.io.*;
public class RainFlowsintoDams {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] arr = new int[n];
		for(int i=0;i<n;i++)
		{
			arr[i]=sc.nextInt();
		}
		for(int i=0;i<n;i++)
		{
			int count =0;
			int place = i;
			int sum = 0;
			int one = 1;
			while(count <n)
			{
				sum+=one*arr[place];
				one*=-1;
				place=(place+1)%n;
				count++;
			}
			System.out.print(sum+" ");
		}
	}

}


Compiler output:
Main.java:3: error: class RainFlowsintoDams is public, should be declared in a file named RainFlowsintoDams.java
public class RainFlowsintoDams {
       ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
  long long n; cin>>n;
  vector<long long> a(n);
  for(int i = 0; i < n; i++){
    cin >> a.at(i);
  }
  long long un = 0, up = a.at(0);
  long long me = (un + up) / 2;
  long long x = me;
  for(int i = 0; i < n; i++){
    x = a.at(i) - x;
  }
  while(un < up){
    if(x > me){
      un = me;
      x -= (un + up) / 2 - me;
      me = (un + up) / 2;
    }else if(x < me){
      up = me;
      x += me - (un + up) / 2;
      me = (un + up) / 2;
    }else{
      break;
    }
  }
  long long x = me;
  for(int i = 0;i < n; i++){
    cout << 2 * x << " ";
    x = a.at(i) - x;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:13: error: redeclaration of 'long long int x'
   29 |   long long x = me;
      |             ^
a.cc:12:13: note: 'long long int x' previously declared here
   12 |   long long x = me;
      |             ^
Language: C++

using namespace std;

int main(){
  int n;
  cin >> n;
  int a[n+1];
  long long x[n+1];
  x[1] = 0;
  for ( int i = 1; i <= n; i++){
    cin >> a[i];
    if ( i % 2 == 0){
      x[1] -= a[i];
    } else {
      x[1] += a[i];
    }
  }

  for ( int i = 2; i <= n; i++){
    x[i] = 2*a[i-1]-x[i-1];
  }
  for (int i = 1; i <= n; i++){
    if ( i > 1) cout << " ";
    cout << x[i];
  }
  cout << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin >> n;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:22:17: error: 'cout' was not declared in this scope
   22 |     if ( i > 1) cout << " ";
      |                 ^~~~
a.cc:22:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:23:5: error: 'cout' was not declared in this scope
   23 |     cout << x[i];
      |     ^~~~
a.cc:23:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:25:3: error: 'cout' was not declared in this scope
   25 |   cout << endl;
      |   ^~~~
a.cc:25:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:25:11: error: 'endl' was not declared in this scope
   25 |   cout << endl;
      |           ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C

#include <bits/stdc++.h>

using namespace std;

int a[100100], m[100100];

int mod(int n, int m){
    if(n > 0) return (n % m);
    else return (n % m + m);
}

int main(){
    int n; 
    long long sm;
    cin >> n;
    for(int i = 1; i <= n; i++) cin >> a[i];
    sm = 0;
    for(int i = 1; i <= n; i++){
        if(i & 1) sm += a[i];
        else sm -= a[i];
    }
    m[1] = sm;
    for(int i = 2; i <= n; i++){
        m[i] = 2 * a[mod(i - 1, n)] - m[mod(i - 1, n)];
    }
    for(int i = 1; i <= n; i++) cout << m[i] << ' ';
    cout << '\n';
}


Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <limits>
#include <random>
#include <complex>
#include <cmath>
#include <cstdio>
#include <cstdlib>
using namespace std;
typedef long long ll;
#define REP(i,n) for (int i = 0; i < n; i++)
template <class T> using reversed_priority_queue = priority_queue<T, vector<T>, greater<T> >;

int main ()
{
    int N; cin >> N;
    vector < ll > A(N);
    REP(i,N) cin >> A[i];

    vector < ll > X(N, 0);
    REP(i,N) {
        if (i % 2 == 0) {
            X[0] += a[i];
        } else {
            X[0] -= a[i];
        }
    }

    for (int i = 1; i < N; i++) {
        X[i] = 2 * a[i - 1] - X[i - 1];
    }

    for (auto x : X) cout << x << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:21: error: 'a' was not declared in this scope
   35 |             X[0] += a[i];
      |                     ^
a.cc:37:21: error: 'a' was not declared in this scope
   37 |             X[0] -= a[i];
      |                     ^
a.cc:42:20: error: 'a' was not declared in this scope
   42 |         X[i] = 2 * a[i - 1] - X[i - 1];
      |                    ^
Language: C++

#include<iostream>
int main(){
  int n;
  std::cin >> n;
  int a[n+1];
  int i;
  int M[n];
  for(i=0;i<n;i++){
    std::cin >> a[i];
  }
  a[n] = a[0];
  M[0] = a[0];
  for(i=1;i<n;i++){
    if(i%2 == 1) M[0] += a[i];
    else M[0] -= a[i];
  }  
  for(i=1;i<n;i++){
    M[i] = 2*a[i] - M[i-1];
  }
  for(i=0;i<n;i++){
    std::cout << M[i] << std::endl;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:22:4: error: expected '}' at end of input
   22 |   }
      |    ^
a.cc:2:11: note: to match this '{'
    2 | int main(){
      |           ^
Language: C++

#include<iostream>
int main(){
  int n;
  std::cin >> n;
  int a[n+1];
  int i;
  int M[n];
  for(i=0;i<n;i++){
    std::cin >> a[i];
  }
  a[n] = a[0];
  M[0] = a[0];
  for(i=1;i<n;i++){
    if(i%2 == 1) M[0] += a[i];
    else M[0] -= a[i];
  }  
  for(i=1;i<n;i++){
    M[i] = 2*a[i] - M[i-1];
  }
  for(i=0;i<n;i++){
    std::cout << M[i] << endl;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:21:26: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   21 |     std::cout << M[i] << endl;
      |                          ^~~~
      |                          std::endl
In file included from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:22:4: error: expected '}' at end of input
   22 |   }
      |    ^
a.cc:2:11: note: to match this '{'
    2 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
#deifne rep(i,n) for(int i=0;i<n;i++)
typedef long long ll;
using namespace std;

int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i,n) cin >> a[i];
  vector<int> x(n);
  rep(i,n){
    if(n%2==0) x[0] += a[i];
    else x[0] -= a[i];
  }
  x[0] = x[0]/2;
  rep(i,n){
    x[i+1] = a[i] - x[i];
  }
  rep(i,n) x[i] *= 2;
  
  rep(i,n) printf(x[i]);
}

Compiler output:
a.cc:2:2: error: invalid preprocessing directive #deifne; did you mean #define?
    2 | #deifne rep(i,n) for(int i=0;i<n;i++)
      |  ^~~~~~
      |  define
a.cc: In function 'int main()':
a.cc:10:7: error: 'i' was not declared in this scope
   10 |   rep(i,n) cin >> a[i];
      |       ^
a.cc:10:3: error: 'rep' was not declared in this scope
   10 |   rep(i,n) cin >> a[i];
      |   ^~~
Language: C

#include<stdio.h>
const int maxn = 1e5;
int a[maxn] = {0},b[maxn] = {0};
int count = 0,sum = 0;
int i;
int main(void)
{
	int n;
	scanf("%d",&n);
	for(i = 1;i<=n;i++)
	{
		scanf("%d",&a[i]);
		sum += a[i];
		if(i % 2 != 0) count += a[i];
	}
	b[1] = (count*2) - sum;
	for(i = 1;i<n;i++)
		b[i+1] = (a[i]*2) - b[i];
	for(i = 1;i<=n;i++)
	{
		if(i == 1) printf("%d",b[i]);
		else printf(" %d",b[i]);
	}
	
	return 0;
}

Compiler output:
main.c:3:5: error: variably modified 'a' at file scope
    3 | int a[maxn] = {0},b[maxn] = {0};
      |     ^
main.c:3:19: error: variably modified 'b' at file scope
    3 | int a[maxn] = {0},b[maxn] = {0};
      |                   ^
Language: C

#include<stdio.h>
const int maxn = 1e7;
int a[maxn] = {0},b[maxn] = {0};
int count = 0,sum = 0;
int i;
int main(void)
{
	int n;
	scanf("%d",&n);
	for(i = 1;i<=n;i++)
	{
		scanf("%d",&a[i]);
		sum += a[i];
		if(i % 2 != 0) count += a[i];
	}
	b[1] = (count*2) - sum;
	for(i = 1;i<n;i++)
		b[i+1] = (a[i]*2) - b[i];
	for(i = 1;i<=n;i++)
	{
		if(i == 1) printf("%d",b[i]);
		else printf(" %d",b[i]);
	}
	
	return 0;
}

Compiler output:
main.c:3:5: error: variably modified 'a' at file scope
    3 | int a[maxn] = {0},b[maxn] = {0};
      |     ^
main.c:3:19: error: variably modified 'b' at file scope
    3 | int a[maxn] = {0},b[maxn] = {0};
      |                   ^
Language: C

#include<stdio.h>
const  int maxn = 1e7;
 int a[maxn],b[maxn];
 int count = 0,sum = 0;
 int i;
int main(void)
{
	 int n;
	scanf("%d",&n);
	for(i = 1;i<=n;i++)
	{
		scanf("%d",&a[i]);
		sum += a[i];
		if(i % 2 != 0) count += a[i];
	}
	b[1] = (count*2) - sum;
	for(i = 1;i<n;i++)
		b[i+1] = (a[i]*2) - b[i];
	for(i = 1;i<=n;i++)
	{
		if(i == 1) printf("%d",b[i]);
		else printf(" %d",b[i]);
	}
	
	return 0;
}

Compiler output:
main.c:3:6: error: variably modified 'a' at file scope
    3 |  int a[maxn],b[maxn];
      |      ^
main.c:3:14: error: variably modified 'b' at file scope
    3 |  int a[maxn],b[maxn];
      |              ^
Language: C

#include<stdio.h>
const unsigned int maxn = 1e7;
unsigned int a[maxn],b[maxn];
unsigned int count = 0,sum = 0;
unsigned int i;
int main(void)
{
	unsigned int n;
	scanf("%d",&n);
	for(i = 1;i<=n;i++)
	{
		scanf("%d",&a[i]);
		sum += a[i];
		if(i % 2 != 0) count += a[i];
	}
	b[1] = (count*2) - sum;
	for(i = 1;i<n;i++)
		b[i+1] = (a[i]*2) - b[i];
	for(i = 1;i<=n;i++)
	{
		if(i == 1) printf("%d",b[i]);
		else printf(" %d",b[i]);
	}
	
	return 0;
}

Compiler output:
main.c:3:14: error: variably modified 'a' at file scope
    3 | unsigned int a[maxn],b[maxn];
      |              ^
main.c:3:22: error: variably modified 'b' at file scope
    3 | unsigned int a[maxn],b[maxn];
      |                      ^
Language: C++

#include<iostream>
using namespace std;
#define ll long long
int main(){
  ll N;
  cin >> N;
  ll a[N];
  ll ans[N];
  ans[0]=0;
  ll tmp=-1;
  for(i=0;i<N;i++){
    cin >> a[i];
    ans[0]+=tmp*a[i];
    tmp*=-1;
  }
  for(i=0;i<N-1;i++){
    ans[i+1]=(a[i]-ans[i]/2)*2;
  }
  for(i=0;i<N;i++){
    cout << ans[i] <<" ";
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:7: error: 'i' was not declared in this scope
   11 |   for(i=0;i<N;i++){
      |       ^
a.cc:16:7: error: 'i' was not declared in this scope
   16 |   for(i=0;i<N-1;i++){
      |       ^
a.cc:19:7: error: 'i' was not declared in this scope
   19 |   for(i=0;i<N;i++){
      |       ^
Language: C++

#include<iostream>
usign namespace std;
#define ll long long
int main(){
  ll N;
  cin >> N;
  ll a[N];
  ll ans[N];
  ans[0]=0;
  ll tmp=-1;
  for(i=0;i<N;i++){
    cin >> a[i];
    ans[0]+=tmp*a[i];
    tmp*=-1;
  }
  for(i=0;i<N-1;i++){
    ans[i+1]=(a[i]-ans[i]/2)*2;
  }
  for(i=0;i<N;i++){
    cout << ans[i] <<" ";
  }
  return 0;
}

Compiler output:
a.cc:2:1: error: 'usign' does not name a type
    2 | usign namespace std;
      | ^~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin >> N;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:11:7: error: 'i' was not declared in this scope
   11 |   for(i=0;i<N;i++){
      |       ^
a.cc:16:7: error: 'i' was not declared in this scope
   16 |   for(i=0;i<N-1;i++){
      |       ^
a.cc:19:7: error: 'i' was not declared in this scope
   19 |   for(i=0;i<N;i++){
      |       ^
a.cc:20:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   20 |     cout << ans[i] <<" ";
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include<iostream>
usign namespace std;
#define ll long long;
int main(){
  ll N;
  cin >> N;
  ll a[N];
  ll ans[N];
  ans[0]=0;
  ll tmp=-1;
  for(i=0;i<N;i++){
    cin >> a[i];
    ans[0]+=tmp*a[i];
    tmp*=-1;
  }
  for(i=0;i<N-1;i++){
    ans[i+1]=(a[i]-ans[i]/2)*2;
  }
  for(i=0;i<N;i++){
    cout << ans[i] <<" ";
  }
  return 0;
}

Compiler output:
a.cc:2:1: error: 'usign' does not name a type
    2 | usign namespace std;
      | ^~~~~
a.cc: In function 'int main()':
a.cc:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
a.cc:5:3: note: in expansion of macro 'll'
    5 |   ll N;
      |   ^~
a.cc:5:6: error: 'N' was not declared in this scope
    5 |   ll N;
      |      ^
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin >> N;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
a.cc:7:3: note: in expansion of macro 'll'
    7 |   ll a[N];
      |   ^~
a.cc:7:6: error: 'a' was not declared in this scope
    7 |   ll a[N];
      |      ^
a.cc:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
a.cc:8:3: note: in expansion of macro 'll'
    8 |   ll ans[N];
      |   ^~
a.cc:8:6: error: 'ans' was not declared in this scope; did you mean 'abs'?
    8 |   ll ans[N];
      |      ^~~
      |      abs
a.cc:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
a.cc:10:3: note: in expansion of macro 'll'
   10 |   ll tmp=-1;
      |   ^~
a.cc:10:6: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   10 |   ll tmp=-1;
      |      ^~~
      |      tm
a.cc:11:7: error: 'i' was not declared in this scope
   11 |   for(i=0;i<N;i++){
      |       ^
a.cc:16:7: error: 'i' was not declared in this scope
   16 |   for(i=0;i<N-1;i++){
      |       ^
a.cc:19:7: error: 'i' was not declared in this scope
   19 |   for(i=0;i<N;i++){
      |       ^
a.cc:20:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   20 |     cout << ans[i] <<" ";
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  
  int sum = 0;
  int tmp = 0;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    sum += a[i];
    if (i != 0 && i != n - 1) tmp += a[i];
  }
  vector<int> ans(n);
  ans[0] = s - 2 * tmp;
  for (int i = 0; i < n - 1; ++i) {
    ans[i + 1] = 2 * a[i] - ans[i];
  }
  for (int i = 0; i < n; ++i) {
    cout << ans[i];
    if (i == n - 1) cout << endl;
    else cout << " ";
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:12: error: 's' was not declared in this scope
   18 |   ans[0] = s - 2 * tmp;
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

/* #pragma */
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")


/*alias*/
#define F first
#define S second

#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
#define next asdnext
#define prev asdprev
#define itn int

/*template*/
template<class T>inline bool amax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>inline bool amin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }

/* func */
int32_t GCD(int32_t a, int32_t b){return b ? GCD(b, a%b) : a;}
int64_t GCD(int64_t a, int64_t b){return b ? GCD(b, a%b) : a;}
int32_t LCM(int32_t a, int32_t b){return a * b / GCD(a, b);}
int64_t LCM(int64_t a, int64_t b){return a * b / GCD(a, b);}

/*struct*/
struct aaa {
	aaa() {
		cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20);
	};
}aaaaaaa;

/* const */
constexpr int32_t INF = 1001001001;
constexpr int64_t LINF = 1001001001001001001ll;
constexpr int32_t MOD = 1e9 + 7; //10^9
constexpr int64_t EPS = 1e-9;
constexpr int32_t dx[] = { 1, 1, 0, -1, -1, -1, 0, 1 }, dy[] = { 0, 1, 1, 1, 0, -1, -1, -1 };
//constexpr int32_t dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};
//Counterclockwise from the 6o'clock direction
//Take the x-axis downward and the y-axis right


//g++ -std=c++14 -Wall --pedantic-errors -o template template.cpp
//g++ -std=c++14 -Wall --pedantic-errors template.cpp
//chcp 65001

/*global*/



//#define int int64_t
signed main()
{
	int n; cin >> n;
	vector<int> a(n);
	for(int i = 0, i_len = (int)n; i < i_len; ++i) cin >> a[i];

	int x2 = 0;
	for(int i = 0; i < n; ++i)
	{
		if(i%%2) x2 -= a[i];
		else x2 += a[i];
	}
	vector<int> ans(n);
	ans[0] = x2/2;
	for(int i = 0; i < n-1; ++i)
	{
		ans[i+1] = a[i] - ans[i];
	}
	for(int i = 0; i < n; ++i){
		ans[i] *= 2;
	}
	for(int i = 0; i < n; ++i){
		cout << ans[i] << '\n';
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:67:22: error: expected primary-expression before '%' token
   67 |                 if(i%%2) x2 -= a[i];
      |                      ^
Language: C++

#include "pch.h"
#include <iostream>
#include <string.h>
#include <string>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cmath>
using namespace std;

long rain(int i, int n, vector< int> c, unsigned long long sum_ ) {
	for (int k = 0; k < (n - 1) / 2; k++) {
		sum_ -= c.at((2*k + 1 + i)%n);
	}
	return 2*sum_;
}
int main(){
	int n;
	unsigned long long sum = 0;
	cin >> n;
	vector< int> a;
	for (int i = 0; i < n; i++) {
		int h;
		cin >> h;
		a.push_back(h);
		sum += h;
	}
	sum /= 2;
		cout << rain(0, n, a, sum) << "\n";
		int pred = rain(0, n, a, sum) / 2;
		for (int i = 0; i < n-1; i++) {
			pred = a.at(i) - pred;
			cout << pred*2 << "\n";
	}

};


Compiler output:
a.cc:1:10: fatal error: pch.h: No such file or directory
    1 | #include "pch.h"
      |          ^~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0 ; i < n ; i++)
using namespace std;
int main() {
  
  int n;
  cin >> n;
  
  vector<int64_t> cont(n);
  vector<int64_t> dam(n);
  
  rep(i,n){
    cin >> cont.at(i)
  }
  
  int a = 0;
  
  rep(i,n){
    
    if(i%2 == 0){
      a += cont.a(i);
    }
    else{
      a -= cont.at(i);
    }
  }
  
  dam.at(0) = a/2;
  
  for(int i = 1; i < n ; i++){
    
    dam.at(i) = cont.at(i) - dam.at(i -1);
    
  }
  
  rep(i,n){ 
    cout << da,.at(i) << " ";
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:22: error: expected ';' before '}' token
   13 |     cin >> cont.at(i)
      |                      ^
      |                      ;
   14 |   }
      |   ~                   
a.cc:21:17: error: 'class std::vector<long int>' has no member named 'a'; did you mean 'at'?
   21 |       a += cont.a(i);
      |                 ^
      |                 at
a.cc:37:13: error: 'da' was not declared in this scope; did you mean 'a'?
   37 |     cout << da,.at(i) << " ";
      |             ^~
      |             a
a.cc:37:16: error: expected primary-expression before '.' token
   37 |     cout << da,.at(i) << " ";
      |                ^
Language: Java

import java.util.*;

public class Main{

	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      	int n = sc.nextInt();
      	int[] a = new int[n];
      	int sum = 0;
      	int sumF1 = 0;
      	int[] x = new int[n];
      	for(int i = 0; i < n; i++){
        	a[i] = sc.nextInt();
          	sum += a[i];
          	if(i % 2 == 0){
            	sumF1 += a[i];
            }
        }
      	int x[0] = sum - 2 * sumF1;
      	System.out.print(x[0]);
      	for(int i = 1; i < n; i ++){
        	x[i] = 2 * a[i] -x[i-1];
          	System.out.print(x[i] + " ");
        }
      	
      	
    
    }
}

Compiler output:
Main.java:19: error: ']' expected
      	int x[0] = sum - 2 * sumF1;
      	      ^
Main.java:19: error: not a statement
      	int x[0] = sum - 2 * sumF1;
      	               ^
2 errors
Language: C++

n=int(input())
aList=list(map(int,input().split()))

for i in range(n):
	r = 0
	for j in range(n):
		k = (i+j)%n
		if j%2 == 0:
			#print('plus')
			r += aList[k]
			#print(aList[k])
		else:
			#print('minus')
			r -= aList[k]
			#print(aList[k])
	print(str(r) ,end=' ')
			
	


Compiler output:
a.cc:9:26: error: invalid preprocessing directive #print
    9 |                         #print('plus')
      |                          ^~~~~
a.cc:11:26: error: invalid preprocessing directive #print
   11 |                         #print(aList[k])
      |                          ^~~~~
a.cc:13:26: error: invalid preprocessing directive #print
   13 |                         #print('minus')
      |                          ^~~~~
a.cc:15:26: error: invalid preprocessing directive #print
   15 |                         #print(aList[k])
      |                          ^~~~~
a.cc:1:1: error: 'n' does not name a type
    1 | n=int(input())
      | ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cin >> n;
	vector <int> a(n);
	for (int i = 0; i < n; i++) {
		//~ scanf("%d", &a[i]);
		cin >> a[i];
	}
	vector <int> h(n);
	for (int i = 0; i < n; i++) {
		if (i & 1) h[0] -= a[i];
		else h[0] += a[i];
	}
	for (int i = 1; i < n; i++) {
		h[i] = 2 * a[i - 1] - h[i - 1];
	}
	for (int i = 0; i < n; i++) {
		//~ printf("%d ", h[i]);
		cout << h[i] << " ";
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: 'n' was not declared in this scope; did you mean 'yn'?
    8 |         cin >> n;
      |                ^
      |                yn
Language: C++

/*input
5
1 2 3 4 5
*/
#include<bits/stdc++.h>
using namespace std;

int b[1000000]
int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int n;
	cin>>n;
	int a[n];
	int b[n];
	int sum =0;

	for(int i = 0; i < n; i++){
		cin>>a[i];
		if(i% 2== 0)
			sum += a[i];
		else
			sum -= a[i];
	}
	for(int i = 0; i < n;i++){
		b[i] = 2* a[i] -sum;
		sum = 2*a[i] -sum;
	}
	for(int i = 0; i < n; i++)cout<<b[i]<<" ";
}

Compiler output:
a.cc:9:1: error: expected initializer before 'int'
    9 | int main(){
      | ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

long long main(){
    long long N;
    vector<long long> A;

    cin >> N;
    for(long long i = 0; i < N; i++){
        long long tmp;
        cin >> tmp;
        A.push_back(tmp);
    }

    vector<long long> solver;
    solver.push_back(0);
    for(long long i = 0; i < N-1; i++){
        solver[i+1] = (A[i] - solver[i]/2) * 2;
    }
    vector<long long> answer;
    answer.push_back(A[N-1] - solver[N-1]/2);
    for(long long i = 0; i < N-1; i++){
        answer[i+1] = (A[i] - answer[i]/2) * 2;
    }

    for(long long i = 0; i < N; i++){
        if(i!= N-1){
            cout << answer[i] << " ";
        }else{
            cout << answer[i] << endl;
        }
    }

}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C

#include <bits/stdc++.h>
using namespace std;

int main(){
    int N;
    vector<int> A;

    cin >> N;
    for(int i = 0; i < N; i++){
        int tmp;
        cin >> tmp;
        A.push_back(tmp);
    }

    vector<int> solver;
    solver.push_back(0);
    for(int i = 0; i < N-1; i++){
        solver[i+1] = (A[i] - solver[i]/2) * 2;
    }
    vector<int> answer;
    answer.push_back(A[N-1] - solver[N-1]/2);
    for(int i = 0; i < N-1; i++){
        answer[i+1] = (A[i] - answer[i]/2) * 2;
    }

    for(int i = 0; i < N; i++){
        if(i!= N-1){
            cout << answer[i] << " ";
        }else{
            cout << answer[i] << endl;
        }
    }

}

Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

using System;

public class Program{
    public static void Main(){
        long N=long.Parse(Console.ReadLine());
        string[] input=Console.ReadLine().Split(' ');
        long[] A=new long[N];
        long[] X=new long[N];
        string ans="";
        for(long i=0;i<N;i++){
            A[i]=long.Parse(input[i]);
        }
        X[0]=A[0];
        for(long i=1;i<N;i++){
            if(i%2==0){
                X[0]+=A[i]; 
            }else{
                X[0]-=A[i];
            }
        }
        X[0]/=2;
        ans+=(X[0]*2).ToString();
        for(long i=1;i<N;i++){
            X[i]=A[i-1]-X[i-1];
            ans+=" "+(X[i]*2).ToString();
        }
        Console.WriteLine(ans);
    }
}


Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Program{
      | ^~~~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<cstdlib>
using namespace std;
int damsum[100001];
int msum[100001];
int main() {
	memset(msum,0,sizeof(msum));
	int n,tsum=0;
	cin>>n;
	for(int i=1;i<=n;i++) {
		cin>>damsum[i];
		tsum+=damsum[i];
	}
	for(int i=1

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'memset' was not declared in this scope
    8 |         memset(msum,0,sizeof(msum));
      |         ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<cstdlib>
  +++ |+#include <cstring>
    4 | using namespace std;
a.cc:15:20: error: expected ';' at end of input
   15 |         for(int i=1
      |                    ^
      |                    ;
a.cc:15:20: error: expected primary-expression at end of input
a.cc:15:20: error: expected ';' at end of input
   15 |         for(int i=1
      |                    ^
      |                    ;
a.cc:15:20: error: expected primary-expression at end of input
a.cc:15:20: error: expected ')' at end of input
   15 |         for(int i=1
      |            ~       ^
      |                    )
a.cc:15:20: error: expected statement at end of input
a.cc:15:20: error: expected '}' at end of input
a.cc:7:12: note: to match this '{'
    7 | int main() {
      |            ^
Language: C++

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] A = new int[N];
		for (int i = 0; i < N; i++) A[i] = sc.nextInt();

		long x2 = 0;
		for (int i = 0; i < N; i++) {
			if(i % 2 == 0) x2 += A[i];
			else x2 -= A[i];
		}
		long[] ans = new long[N];
		ans[0] = x2 / 2;
		for (int i = 0; i < N - 1; i++) ans[i + 1] = A[i] - ans[i];
		for (int i = 0; i < N; i++) ans[i] *= 2;
		for (int i = 0; i < N; i++) System.out.println(ans[i] + " ");
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: C++

#include <iostream> 
#include <vector>
using namespace std;
 
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
 
	int n;
	int sum=0;
 
	cin >> n;
	vector<int> x(n, 0);
 
	
	
	for (int i = 0; i < n; i++){
		cin >> x[i];
		if (i % 2 == 0)	sum += x[i];
		else sum -= x[i];
	}
 
	for (int i = 0; i < n; i++){
		if (i != 0)  sum= 2 * x[i-1] - sum;
		else sum = sum;
		cout << sum << " ";
	}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:10: error: expected '}' at end of input
   27 |         }
      |          ^
a.cc:5:12: note: to match this '{'
    5 | int main() {
      |            ^
Language: C++

#include <stdio.h>
int N;
int main (void){
  if(scanf("%d",&N) == 1);
  int x[N][2];
  for(int i = 0;i < N;i++){
    if(scanf("%d",&x[i][1]) == 1);
  }
  for(int i = 0;i < N;i++){
    int c = i;
    for(int j = 0;j < N;j++;){
      if(j % 2 == 0){
        x[i][2] = x[i][2] + x[c][1];
      }
      if(j % 2 == 1){
        x[i][2] = x[i][2] - x[c][1];
      }
      c++;
      if(c ==N){
        c = 0;
      }
    }
  }
  for(int n = 0;n < N;n++){
    printf("%d",x[n][2]);
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:28: error: expected ')' before ';' token
   11 |     for(int j = 0;j < N;j++;){
      |        ~                   ^
      |                            )
a.cc:11:29: error: expected primary-expression before ')' token
   11 |     for(int j = 0;j < N;j++;){
      |                             ^
Language: C++

#include stdio.h;

int N;
int main(void){
  if(scanf("%d",&N) == 1);
  int x[N][2];
  for(int i = 0;i < N;i++){
    if(scanf("%d",&x[i][1]) == 1);
  }
  for(int i = 0;i < N;i++){
    int c = i;
    for(int j = 0;j < N;j++;){
      if(j % 2 == 0){
        x[i][2] = x[i][2] + x[c][1];
      }
      if(j % 2 == 1){
        x[i][2] = x[i][2] - x[c][1];
      }
      c++;
      if(c ==N){
        c = 0;
      }
    }
  }
  for(int n = 0;n < N;n++){
    printf("%d",x[n][2]);
  }
  return 0;
}

Compiler output:
a.cc:1:10: error: #include expects "FILENAME" or <FILENAME>
    1 | #include stdio.h;
      |          ^~~~~
a.cc: In function 'int main()':
a.cc:5:6: error: 'scanf' was not declared in this scope
    5 |   if(scanf("%d",&N) == 1);
      |      ^~~~~
a.cc:8:8: error: 'scanf' was not declared in this scope
    8 |     if(scanf("%d",&x[i][1]) == 1);
      |        ^~~~~
a.cc:12:28: error: expected ')' before ';' token
   12 |     for(int j = 0;j < N;j++;){
      |        ~                   ^
      |                            )
a.cc:12:29: error: expected primary-expression before ')' token
   12 |     for(int j = 0;j < N;j++;){
      |                             ^
a.cc:26:5: error: 'printf' was not declared in this scope
   26 |     printf("%d",x[n][2]);
      |     ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | #include stdio.h;
Language: C++

#include<bits/stdc++.h>
#include<algorithm>
#include<math.h>
#include<string>
#include<iostream>
#include<vector>
#include<cstdlib>
using namespace std;
 
template <class T> using V = vector<T>;
 
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
 
const long long INF = 1LL << 60;
 
using ll = long long;
using db = double;
using st = string;
using ch = char;
using bl = bool;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;
using vbl = V<bl>;
 
 
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define rFOR(i,a,b) for(ll i=(a);i>=(b);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define M(a,b) max(a,b)
#define rM(a,b) min(a,b)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define co(a) cout<<a<<endl;
#define ci(a) cin>>a;
 
 
ll sum(ll n) {
  ll m=0;
  FOR(i,0,20){
    m+=n%10;
    n/=10;
    if(n==0){
      break;
    }
  }
  return m;
}
 
 
const int MAX = 510000;
const int MOD = 1000000007;
 
long long fac[MAX], finv[MAX], inv[MAX];
 
void Comuse() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
 
 
#define comuse Comuse()
 
ll combi(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
 
 
 
 
ll lcm(ll a,ll b){
  ll n;
  n=a/gcd(a,b)*b;
  return n;
}
 
 
/****************************************\
| Thank you for viewing my code:)        |
| Written by RedSpica a.k.a. RanseMirage |
| Twitter:@asakaakasaka                  | 
\****************************************/
 
 
signed main() {
  ll n;
    ci(n);
  vll A(n);
  ll sum=0;
  ll all=0;
  FOR(i,0,n){
    ci(A[i])
    all+=A[i];
    if(i%2==0){
      sum+=A[i];
    }
  }
  all/=2;
  A[n-i]-=sum-all;
  rFOR(i,n-2,0){
    A[i]-=A[i+1];
  }
  FOR(i,0,n){
    co(2*A[i])
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:128:7: error: 'i' was not declared in this scope
  128 |   A[n-i]-=sum-all;
      |       ^
Language: C++

#include <algorithm>
#include <iostream>
#include <limits>
#include <vector>

using ::std::cin;
using ::std::cout;
using ::std::endl;
using ::std::string;
using ::std::vector;

using LL = long long;

vector<int> ReadIntVector(int n) {
  vector<int> xs(n);
  for (int i = 0; i < n; i++) {
    cin >> xs[i];
  }
  return xs;
}

vector<LL> ReadLLVector(int n) {
  vector<LL> xs(n);
  for (int i = 0; i < n; i++) {
    cin >> xs[i];
  }
  return xs;
}

LL LLVectorToSum(const vector<LL>& xs) {
  LL sum = 0;
  for (LL x : xs) {
    sum += x;
  }
  return sum;
}

string LLVectorToString(const vector<LL>& xs, const string& separator) {
  string output;
  for (int i = 0; i < xs.size; i++) {
    if (i > 0) output.append(separator);
    output.append(std::to_string(xs[i]));
  }
  return output;
}

int main() {
  int n;
  cin >> n;
  vector<LL> ds = ReadLLVector(n);

  LL sum = LLVectorToSum(ds);

  LL subSum = 0;
  for (int i = 1; i <= n - 2; i += 2) {
    subSum += 2 * ds[i];
  }

  // cout << sum << " " << subSum << endl;

  vector<LL> xs(n);
  xs[0] = sum - subSum;
  for (int i = 1; i < n; i++) {
    xs[i] = (ds[i - 1] - xs[i - 1] / 2) * 2;
  }

  string output = LLVectorToString(xs, " ");
  cout << output << endl;
  return 0;
}

Compiler output:
a.cc: In function 'std::string LLVectorToString(const std::vector<long long int>&, const std::string&)':
a.cc:40:26: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = long long int; _Alloc = std::allocator<long long int>; size_type = long unsigned int]' (did you forget the '()' ?)
   40 |   for (int i = 0; i < xs.size; i++) {
      |                       ~~~^~~~
      |                              ()
Language: C++

#include <bits/stdc++.h>
#define debug(x) cerr << "\n" \
                      << #x << ": " << x << "\n"
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define int long long
#define print(x) cout << (x) << endl
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int INF = (1LL << 30);
const ll MOD = 1000000007;

//=============================================================
//=============================================================

/*
 */
int N;
vector<int> A;
int suma = 0;

int getA(int ind)
{
    if (ind < 0)
        return A[N - 1];
    if (ind >= N)
        return A[0];
    else
        return A[ind];
}
void setA(int ind, int val)
{
    if (ind < 0)
        A[N - 1] = val;
    if (ind >= N)
        A[0] = val;
    else
        A[ind] = val;
}


void solve()
{

    vector<int> rain(N);
    int tmp = 0;
    for (int i = 1; i < N; ++i) {
        if (i % 2) tm += A[i]*2;
    }
    rain[0] = tm;
    for (int i = 1; i < N; ++i) {
        rain[1] = A[i-1]*2 - rain[i-1];
    }


    for (auto x: rain){
        cout<<x<<" ";
    }
    cout<<endl;
}
signed main()
{
    cin >> N;
    rep(i, N)
    {
        int tmp;
        suma += tmp;
        cin >> tmp;
        A.push_back(tmp);
    }
    solve();
    return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:49:23: error: expected unqualified-id before '+=' token
   49 |         if (i % 2) tm += A[i]*2;
      |                       ^~
a.cc:51:17: error: expected primary-expression before ';' token
   51 |     rain[0] = tm;
      |                 ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  int64_t A[N];
  for(int i = 0; i < N; i++) {
    cin >> A[i];
  }
  int64_t sum = 0;
  for(int i = 0; i < N; i++) {
    sum += A[i];
  }
  int64_t sum1 = 0; 
  int D = 0;
  for(int j = 0; j < (N+1)/2; j++) {
    sum1 += A[D];
    D += 2;
  }
  int64_t x1 = 2 * sum1 - sum;
  cout << x1 << endl;
  }
  for(int i = 0; i < N - 1; i++) {
    x1 = 2 * A[i] - x1;
    cout << x1 << endl;
  }
  cout << endl;
}

Compiler output:
a.cc:24:3: error: expected unqualified-id before 'for'
   24 |   for(int i = 0; i < N - 1; i++) {
      |   ^~~
a.cc:24:18: error: 'i' does not name a type
   24 |   for(int i = 0; i < N - 1; i++) {
      |                  ^
a.cc:24:29: error: 'i' does not name a type
   24 |   for(int i = 0; i < N - 1; i++) {
      |                             ^
a.cc:28:3: error: 'cout' does not name a type
   28 |   cout << endl;
      |   ^~~~
a.cc:29:1: error: expected declaration before '}' token
   29 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  int A[N];
  for(int i = 0; i < N; i++) {
    cin >> A[i];
  }
  int sum64_t = 0;
  for(int i = 0; i < N; i++) {
    sum += A[i];
  }
  int64_t sum1 = 0; 
  int D = 0;
  for(int j = 0; j < (N+1)/2; j++) {
    sum1 += A[D];
    D += 2;
  }
  int x1 = 2 * sum1 - sum;
  cout << x1 << endl;
  }
  for(int i = 0; i < N-1; i++) {
    x1 = 2 * A[i] - x1;
    cout << x1 << endl;
  }
  cout << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'sum' was not declared in this scope
   13 |     sum += A[i];
      |     ^~~
a.cc:21:23: error: 'sum' was not declared in this scope; did you mean 'sum1'?
   21 |   int x1 = 2 * sum1 - sum;
      |                       ^~~
      |                       sum1
a.cc: At global scope:
a.cc:24:3: error: expected unqualified-id before 'for'
   24 |   for(int i = 0; i < N-1; i++) {
      |   ^~~
a.cc:24:18: error: 'i' does not name a type
   24 |   for(int i = 0; i < N-1; i++) {
      |                  ^
a.cc:24:27: error: 'i' does not name a type
   24 |   for(int i = 0; i < N-1; i++) {
      |                           ^
a.cc:28:3: error: 'cout' does not name a type
   28 |   cout << endl;
      |   ^~~~
a.cc:29:1: error: expected declaration before '}' token
   29 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  int A[N];
  for(int i = 0; i < N; i++) {
    cin >> A[i];
  }
  int sum = 0;
  for(int i = 0; i < N; i++) {
    sum += A[i];
  }
  for(int i = 0; i < N; i++) {
    int sum1 = 0;
    int D = i;  
    for(int j = 0; j < (N+1)/2; j++) {
      sum1 += A[D];
      D += 2;
    }
    cout << 2 * sum1 - sum;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:23:4: error: expected '}' at end of input
   23 |   }
      |    ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C

#include <stdio.h>

int main()
{
	const int N = 100000;

	int n;
	long long a[N];
	long long x[N] = { 0LL };

	scanf("%d", &n);

	for(int i = 0; i < n; ++i)
	{
		scanf("%lld", &a[i]);
	}

	int sign = 1;
	for(int i = 0; i < n; ++i)
	{
		x[0] += a[i] * sign;
		sign *= -1;
	}

	for(int i = n - 1; i > 0; --i)
	{
		x[i] = 2 * a[i] - x[(i + 1) % n];
	}

	printf("%lld", x[0]);
	for(int i = 1; i < n; ++i)
	{
		printf(" %lld", x[i]);
	}
	printf("\n");
}

Compiler output:
main.c: In function 'main':
main.c:9:26: error: variable-sized object may not be initialized except with an empty initializer
    9 |         long long x[N] = { 0LL };
      |                          ^
Language: Java

import java.util.Scanner;

public class ABC133 {

	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int N = scn.nextInt();
		long[] A = new long[N];
		for(int i = 0;i < N;i++) {
			A[i] = scn.nextLong();
		}
		long[] ans = new long[N];
		boolean plus = true;
		for(int i = 0;i < N;i++) {
			ans[0] += plus?A[i]:-A[i];
			plus = !plus;
		}
		for(int i = 1;i <N;i++) {
			ans[i] = 2 * (A[i-1] - ans[i-1]/2);
		}
		for(int i = 0;i < N;i++) {
			System.out.print(((i==0)?"":" ") + ans[i]);
		}
	}

}

Compiler output:
Main.java:3: error: class ABC133 is public, should be declared in a file named ABC133.java
public class ABC133 {
       ^
1 error
Language: C++

#include<cmath>
using namespace std;

int main(){
	int n;
	cin >> n;
	int a[n];
	for(int in=0;in<n;in++){
		cin >> a[in];
	}

	int b[n];
	b[0] = a[0];
	for(int in=0;in<n/2;in++){
		b[0] += a[2*in+1]-a[2*in+2];
	}
	for(int in=0;in<n-1;in++){
		b[i+1] = a[i+1]-b[i];
	}

	for(int in=0;in<n;in++){
		cout << b[i];
	}


	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope
    6 |         cin >> n;
      |         ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<cmath>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:18:19: error: 'i' was not declared in this scope; did you mean 'in'?
   18 |                 b[i+1] = a[i+1]-b[i];
      |                   ^
      |                   in
a.cc:22:17: error: 'cout' was not declared in this scope
   22 |                 cout << b[i];
      |                 ^~~~
a.cc:22:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:22:27: error: 'i' was not declared in this scope; did you mean 'in'?
   22 |                 cout << b[i];
      |                           ^
      |                           in
Language: C++

#include<iostream>
#include<cmath>
using namespace std;

int main(){
	int n;
	cin >> n;
	int a[n];
	for(int in=0;in<n;in++){
		cin >> a[in];
	}

	int b[n];
	b[0] = a[0];
	for(in=0;in<n/2;in++){
		b[0] += a[2*in+1]-a[2*in+2];
	}
	for(in=0;in<n-1;in++){
		b[i+1] = a[i+1]-b[i];
	}

	for(in=0;in<n;in++){
		cout << b[i];
	}


	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:13: error: 'in' was not declared in this scope; did you mean 'n'?
   15 |         for(in=0;in<n/2;in++){
      |             ^~
      |             n
a.cc:18:13: error: 'in' was not declared in this scope; did you mean 'n'?
   18 |         for(in=0;in<n-1;in++){
      |             ^~
      |             n
a.cc:19:19: error: 'i' was not declared in this scope
   19 |                 b[i+1] = a[i+1]-b[i];
      |                   ^
a.cc:22:13: error: 'in' was not declared in this scope; did you mean 'n'?
   22 |         for(in=0;in<n;in++){
      |             ^~
      |             n
a.cc:23:27: error: 'i' was not declared in this scope
   23 |                 cout << b[i];
      |                           ^