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

#include <bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i=0,i++,i<n){
    cin >> v.at(i);
  }
  vector<int> w(n);
  for (int i=0,i++,i<n){
    cin >> w.at(i);
  }
  vector<int> vw(n);
  for (int i=0,i++,i<n){
    vw.at(i) = v.at(i) - w.at(i);
  }
  sort(vw.begin(),vw.end());
  reverse(vw.begin(),vw.end());
  int count = 0;
  int j = 0;
  while (vw.at(j) > 0){
    count += vw.at(j);
    j++;
  }
  cout << count << endl;
   
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: expected ';' before '++' token
    7 |   for (int i=0,i++,i<n){
      |                 ^~
      |                 ;
a.cc:7:19: error: expected primary-expression before ',' token
    7 |   for (int i=0,i++,i<n){
      |                   ^
a.cc:7:23: error: expected ';' before ')' token
    7 |   for (int i=0,i++,i<n){
      |                       ^
      |                       ;
a.cc:11:17: error: expected ';' before '++' token
   11 |   for (int i=0,i++,i<n){
      |                 ^~
      |                 ;
a.cc:11:19: error: expected primary-expression before ',' token
   11 |   for (int i=0,i++,i<n){
      |                   ^
a.cc:11:23: error: expected ';' before ')' token
   11 |   for (int i=0,i++,i<n){
      |                       ^
      |                       ;
a.cc:15:17: error: expected ';' before '++' token
   15 |   for (int i=0,i++,i<n){
      |                 ^~
      |                 ;
a.cc:15:19: error: expected primary-expression before ',' token
   15 |   for (int i=0,i++,i<n){
      |                   ^
a.cc:15:23: error: expected ';' before ')' token
   15 |   for (int i=0,i++,i<n){
      |                       ^
      |                       ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin >> n;
  vector<int> v(n);
  for (i=0,i++,i<n){
    cin >> v.at(i);
  }
  vector<int> w(n);
  for (i=0,i++,i<n){
    cin >> w.at(i);
  }
  vector<int> vw(n);
  for (i=0,i++,i<n){
    vw.at(i) = v.at(i) - w.at(i);
  }
  sort(vw.begin(),vw.end());
  reverse(vw.begin(),vw.end());
  int count = 0;
  int j = 0;
  while (vw.at(j) > 0){
    count += vw.at(j);
    j++;
  }
  cout << count << endl;
   
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:8: error: 'i' was not declared in this scope
    7 |   for (i=0,i++,i<n){
      |        ^
a.cc:10:16: error: expected initializer before '(' token
   10 |   vector<int> w(n);
      |                ^
a.cc:10:16: error: could not convert 'w' from 'std::vector<int>' to 'bool'
   10 |   vector<int> w(n);
      |                ^
      |                |
      |                std::vector<int>
a.cc:10:16: error: expected ';' before '(' token
   10 |   vector<int> w(n);
      |                ^
      |                ;
a.cc:10:19: error: expected ')' before ';' token
   10 |   vector<int> w(n);
      |                   ^
      |                   )
a.cc:7:7: note: to match this '('
    7 |   for (i=0,i++,i<n){
      |       ^
a.cc:11:8: error: 'i' was not declared in this scope
   11 |   for (i=0,i++,i<n){
      |        ^
a.cc:14:17: error: expected initializer before '(' token
   14 |   vector<int> vw(n);
      |                 ^
a.cc:14:17: error: could not convert 'vw' from 'std::vector<int>' to 'bool'
   14 |   vector<int> vw(n);
      |                 ^
      |                 |
      |                 std::vector<int>
a.cc:14:17: error: expected ';' before '(' token
   14 |   vector<int> vw(n);
      |                 ^
      |                 ;
a.cc:14:20: error: expected ')' before ';' token
   14 |   vector<int> vw(n);
      |                    ^
      |                    )
a.cc:11:7: note: to match this '('
   11 |   for (i=0,i++,i<n){
      |       ^
a.cc:15:8: error: 'i' was not declared in this scope
   15 |   for (i=0,i++,i<n){
      |        ^
a.cc:18:8: error: 'vw' was not declared in this scope; did you mean 'v'?
   18 |   sort(vw.begin(),vw.end());
      |        ^~
      |        v
a.cc:19:31: error: expected ')' before ';' token
   19 |   reverse(vw.begin(),vw.end());
      |                               ^
      |                               )
a.cc:15:7: note: to match this '('
   15 |   for (i=0,i++,i<n){
      |       ^
a.cc:22:10: error: 'vw' was not declared in this scope; did you mean 'v'?
   22 |   while (vw.at(j) > 0){
      |          ^~
      |          v
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main{
  int n;
  cin >> n;
  vector<int> v(n);
  for (i=0,i++,i<n){
    cin >> v.at(i);
  }
  vector<int> w(n);
  for (i=0,i++,i<n){
    cin >> w.at(i);
  }
  vector<int> vw(n);
  for (i=0,i++,i<n){
    vw.at(i) = v.at(i) - w.at(i);
  }
  sort(vw.begin(),vw.end());
  reverse(vw.begin(),vw.end());
  int count = 0;
  int j = 0;
  while (vw.at(j) > 0){
    count += vw.at(j);
    j++;
  }
  cout << count << endl;
   
}


Compiler output:
a.cc:3:5: error: cannot declare '::main' to be a global variable
    3 | int main{
      |     ^~~~
a.cc:4:3: error: expected primary-expression before 'int'
    4 |   int n;
      |   ^~~
a.cc:4:3: error: expected '}' before 'int'
a.cc:3:9: note: to match this '{'
    3 | int main{
      |         ^
a.cc:5:3: error: 'cin' does not name a type
    5 |   cin >> n;
      |   ^~~
a.cc:6:17: error: 'n' was not declared in this scope; did you mean 'yn'?
    6 |   vector<int> v(n);
      |                 ^
      |                 yn
a.cc:7:3: error: expected unqualified-id before 'for'
    7 |   for (i=0,i++,i<n){
      |   ^~~
a.cc:10:17: error: 'n' was not declared in this scope; did you mean 'yn'?
   10 |   vector<int> w(n);
      |                 ^
      |                 yn
a.cc:11:3: error: expected unqualified-id before 'for'
   11 |   for (i=0,i++,i<n){
      |   ^~~
a.cc:14:18: error: 'n' was not declared in this scope; did you mean 'yn'?
   14 |   vector<int> vw(n);
      |                  ^
      |                  yn
a.cc:15:3: error: expected unqualified-id before 'for'
   15 |   for (i=0,i++,i<n){
      |   ^~~
a.cc:18:7: error: expected constructor, destructor, or type conversion before '(' token
   18 |   sort(vw.begin(),vw.end());
      |       ^
a.cc:19:10: error: expected constructor, destructor, or type conversion before '(' token
   19 |   reverse(vw.begin(),vw.end());
      |          ^
a.cc:22:3: error: expected unqualified-id before 'while'
   22 |   while (vw.at(j) > 0){
      |   ^~~~~
a.cc:26:3: error: 'cout' does not name a type
   26 |   cout << count << endl;
      |   ^~~~
a.cc:28:1: error: expected declaration before '}' token
   28 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main{
  int n;
  cin >> n;
  vector<int> v(n);
  for (i=0,i++,i<n){
    cin >> v.at(i);
  }
  vector<int> w(n);
  for (i=0,i++,i<n){
    cin >> w.at(i);
  }
  vector<int> vw(n);
  for (i=0,i++,i<n){
    vw.at(i) = v.at(i) - w.at(i);
  }
  sort(vw.begin(),vw.end());
  reverse(vw.begin(),vw.end());
  int count = 0;
  int j = 0;
  while (vw.at(j) > 0){
    count += vw.at(j);
  }
  cout << count << endl;
   
}


Compiler output:
a.cc:3:5: error: cannot declare '::main' to be a global variable
    3 | int main{
      |     ^~~~
a.cc:4:3: error: expected primary-expression before 'int'
    4 |   int n;
      |   ^~~
a.cc:4:3: error: expected '}' before 'int'
a.cc:3:9: note: to match this '{'
    3 | int main{
      |         ^
a.cc:5:3: error: 'cin' does not name a type
    5 |   cin >> n;
      |   ^~~
a.cc:6:17: error: 'n' was not declared in this scope; did you mean 'yn'?
    6 |   vector<int> v(n);
      |                 ^
      |                 yn
a.cc:7:3: error: expected unqualified-id before 'for'
    7 |   for (i=0,i++,i<n){
      |   ^~~
a.cc:10:17: error: 'n' was not declared in this scope; did you mean 'yn'?
   10 |   vector<int> w(n);
      |                 ^
      |                 yn
a.cc:11:3: error: expected unqualified-id before 'for'
   11 |   for (i=0,i++,i<n){
      |   ^~~
a.cc:14:18: error: 'n' was not declared in this scope; did you mean 'yn'?
   14 |   vector<int> vw(n);
      |                  ^
      |                  yn
a.cc:15:3: error: expected unqualified-id before 'for'
   15 |   for (i=0,i++,i<n){
      |   ^~~
a.cc:18:7: error: expected constructor, destructor, or type conversion before '(' token
   18 |   sort(vw.begin(),vw.end());
      |       ^
a.cc:19:10: error: expected constructor, destructor, or type conversion before '(' token
   19 |   reverse(vw.begin(),vw.end());
      |          ^
a.cc:22:3: error: expected unqualified-id before 'while'
   22 |   while (vw.at(j) > 0){
      |   ^~~~~
a.cc:25:3: error: 'cout' does not name a type
   25 |   cout << count << endl;
      |   ^~~~
a.cc:27:1: error: expected declaration before '}' token
   27 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main{
  int n;
  cin >> n;
  vector<int> v(n);
  for (i=0,i++,i<n){
    cin >> v.at(i);
  }
  vector<int> w(n);
  for (i=0,i++,i<n){
    cin >> w.at(i);
  }
  vector<int> vw(n);
  for (i=0,i++,i<n){
    vw.at(i) = v.at(i) - w.at(i);
  }
  sort(vw.begin(),vw.end());
  reverse(vw.begin(),vw.end());
  int count = 0;
  int j = 0
  while (vw.at(j) > 0){
    count += vw.at(j);
  }
  cout << count << endl;
   
}


Compiler output:
a.cc:3:5: error: cannot declare '::main' to be a global variable
    3 | int main{
      |     ^~~~
a.cc:4:3: error: expected primary-expression before 'int'
    4 |   int n;
      |   ^~~
a.cc:4:3: error: expected '}' before 'int'
a.cc:3:9: note: to match this '{'
    3 | int main{
      |         ^
a.cc:5:3: error: 'cin' does not name a type
    5 |   cin >> n;
      |   ^~~
a.cc:6:17: error: 'n' was not declared in this scope; did you mean 'yn'?
    6 |   vector<int> v(n);
      |                 ^
      |                 yn
a.cc:7:3: error: expected unqualified-id before 'for'
    7 |   for (i=0,i++,i<n){
      |   ^~~
a.cc:10:17: error: 'n' was not declared in this scope; did you mean 'yn'?
   10 |   vector<int> w(n);
      |                 ^
      |                 yn
a.cc:11:3: error: expected unqualified-id before 'for'
   11 |   for (i=0,i++,i<n){
      |   ^~~
a.cc:14:18: error: 'n' was not declared in this scope; did you mean 'yn'?
   14 |   vector<int> vw(n);
      |                  ^
      |                  yn
a.cc:15:3: error: expected unqualified-id before 'for'
   15 |   for (i=0,i++,i<n){
      |   ^~~
a.cc:18:7: error: expected constructor, destructor, or type conversion before '(' token
   18 |   sort(vw.begin(),vw.end());
      |       ^
a.cc:19:10: error: expected constructor, destructor, or type conversion before '(' token
   19 |   reverse(vw.begin(),vw.end());
      |          ^
a.cc:22:3: error: expected ',' or ';' before 'while'
   22 |   while (vw.at(j) > 0){
      |   ^~~~~
a.cc:25:3: error: 'cout' does not name a type
   25 |   cout << count << endl;
      |   ^~~~
a.cc:27:1: error: expected declaration before '}' token
   27 | }
      | ^
Language: C++

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

void main() {
	
	int juwelry_count;
	cin >> juwelry_count;

	vector<int> juwelry_values;
	for (int index = 0; index < juwelry_count; index++) {
		int juwelry_value;
		cin >> juwelry_value;
		juwelry_values.push_back(juwelry_value);
	}

	vector<int> juwelry_costs;
	for (int index = 0; index < juwelry_count; index++) {
		int juwelry_cost;
		cin >> juwelry_cost;
		juwelry_costs.push_back(juwelry_cost);
	}

	vector<int> juwelry_ranks;
	for (int index = 0; index < juwelry_count; index++) {
		int juwelry_rank;
		
		juwelry_rank = juwelry_values[index] - juwelry_costs[index];
		juwelry_ranks.push_back(juwelry_rank);
	}

	int max_calucuration = 0;
	for (int index = 0; index < juwelry_ranks.size; index++) {
		if (juwelry_ranks[index] > 0) {
			max_calucuration += juwelry_ranks[index];
		}
	}

	cout << max_calucuration;
}

Compiler output:
a.cc:5:1: error: '::main' must return 'int'
    5 | void main() {
      | ^~~~
a.cc: In function 'int main()':
a.cc:33:51: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = int; _Alloc = std::allocator<int>; size_type = long unsigned int]' (did you forget the '()' ?)
   33 |         for (int index = 0; index < juwelry_ranks.size; index++) {
      |                                     ~~~~~~~~~~~~~~^~~~
      |                                                       ()
Language: C++

#include <iostream>
using namespace std;
int main() {
  int N,c[N],v[N],sum;
  cin>>c[N]>>v[N];
  
  sum=0;
  
  for (i=1,i<=N,i++)
  if (v[i]-c[i]>=0){
    sum+=v[i]-c[i]
  }
  
  cout<<sum<<endl;
}
  
   
    

Compiler output:
a.cc: In function 'int main()':
a.cc:9:8: error: 'i' was not declared in this scope
    9 |   for (i=1,i<=N,i++)
      |        ^
a.cc:15:1: error: expected primary-expression before '}' token
   15 | }
      | ^
a.cc:14:19: error: expected ')' before '}' token
   14 |   cout<<sum<<endl;
      |                   ^
      |                   )
   15 | }
      | ~                  
a.cc:9:7: note: to match this '('
    9 |   for (i=1,i<=N,i++)
      |       ^
a.cc:15:1: error: expected primary-expression before '}' token
   15 | }
      | ^
Language: C++

#include <cstdio>
#include <iostream>

int
main(int argc, char**argv) {
    int N;
    int V[50] = {0}, C[50] = {0};

    std::cin >> N;
    for (auto i = 0; i < N; i++) {
    |   std::cin >> V[i];
    }
    for (auto i = 0; i < N; i++) {
    |   std::cin >> C[i];
    }

    int X, Y;
    X = Y = 0;
    for (auto i = 0; i < N; i++) {
    |   if (V[i] > C[i]) {
    |   |   X += V[i];
    |   |   Y += C[i];
    |   }
    }
    std::printf("%d\n", X- Y);
    return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:11:5: error: expected primary-expression before '|' token
   11 |     |   std::cin >> V[i];
      |     ^
a.cc:14:5: error: expected primary-expression before '|' token
   14 |     |   std::cin >> C[i];
      |     ^
a.cc:20:5: error: expected primary-expression before '|' token
   20 |     |   if (V[i] > C[i]) {
      |     ^
a.cc:20:9: error: expected primary-expression before 'if'
   20 |     |   if (V[i] > C[i]) {
      |         ^~
Language: Java

import java.util.Scanner;
import java.util.Arrays;
import java.util.ArrayList;

public class Main{
    public static void main(String[]args){

        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int[] V = new int [N];
        int[] C = new int [N];
        int[] P = new int [N];
        int t = 0;

        for(int i=1;i<=N;i++){
            V[i] = nextInt();
            C[i] = nextInt();
            P[i] = V[i]-C[i];

            if(P[i]>0){
                t+=P[i];
            }
        } 
    }
}

Compiler output:
Main.java:17: error: cannot find symbol
            V[i] = nextInt();
                   ^
  symbol:   method nextInt()
  location: class Main
Main.java:18: error: cannot find symbol
            C[i] = nextInt();
                   ^
  symbol:   method nextInt()
  location: class Main
2 errors
Language: C

#include<stdio.h>

int main(void)
{
    int N;
    scanf("%d", &N);
    int V[50];
    int C[50];
    for(int i=0;i<N;i++)
    {
        scanf("%d%d",&V[i],&C[i]);
    }

    max=0;
    for(int i=0;i<N;i++)
    {
        if(max<V[i]-C[i])
            max=V[i]-C[i];
    }
    printf("%d\n",max);
}

Compiler output:
main.c: In function 'main':
main.c:14:5: error: 'max' undeclared (first use in this function)
   14 |     max=0;
      |     ^~~
main.c:14:5: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

int main(void)
{
    int N;
    scanf("%d", &N);
    int V[50];
    int C[50]
    for(int i=0;i<N;i++)
    {
        scanf("%d%d",&V[i],&C[i]);
    }

    max=0;
    for(int i=0;i<N;i++)
    {
        if(max<V[i]-C[i])
            max=V[i]-C[i];
    }
    printf("%d\n",max);
}

Compiler output:
main.c: In function 'main':
main.c:9:5: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'for'
    9 |     for(int i=0;i<N;i++)
      |     ^~~
main.c:11:29: error: 'C' undeclared (first use in this function)
   11 |         scanf("%d%d",&V[i],&C[i]);
      |                             ^
main.c:11:29: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:5: error: 'max' undeclared (first use in this function)
   14 |     max=0;
      |     ^~~
Language: C++

#include <iostream>

using namespace std;

int V[30] = {0);
int C[30] = {0);
int g[30] = {0);

int main()
{
	int N;
	cin >> N;
	for (int i = 0; i < N; i++)
		cin >> V[i];
		
	for (int i = 0; i < N; i++)
	{
		cin >> C[i];
		g[i] = V[i] - C[i];
	}
	int ans = 0;
	for (int i = 0; i < N; i++)
	{
		if (g[i] > 0)
			ans += g[i];
	}
	cout << ans << endl;
		
	return 0;
}

Compiler output:
a.cc:5:15: error: expected '}' before ')' token
    5 | int V[30] = {0);
      |             ~ ^
a.cc:5:15: error: expected ',' or ';' before ')' token
a.cc:6:15: error: expected '}' before ')' token
    6 | int C[30] = {0);
      |             ~ ^
a.cc:6:15: error: expected ',' or ';' before ')' token
a.cc:7:15: error: expected '}' before ')' token
    7 | int g[30] = {0);
      |             ~ ^
a.cc:7:15: error: expected ',' or ';' before ')' token
Language: C++

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

int main() {
  int N;
  int max = 0;
  vector<int> cost(N)
  vector<int> value(N);
  
  cin >> N;
  for (int i = 0; i < N; i++) cin >> value[i];
  for (int i = 0; i < N; i++) cin >> cost[i];
  
  for (int i = 0; i < N; i++) {
    if ((value[i] - cost[i]) > 0) max += value[i] - cost[i];
  }
  
  cout << max << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: expected ',' or ';' before 'vector'
    9 |   vector<int> value(N);
      |   ^~~~~~
a.cc:12:38: error: 'value' was not declared in this scope
   12 |   for (int i = 0; i < N; i++) cin >> value[i];
      |                                      ^~~~~
a.cc:16:10: error: 'value' was not declared in this scope
   16 |     if ((value[i] - cost[i]) > 0) max += value[i] - cost[i];
      |          ^~~~~
Language: C++

N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
ans = 0
for i in range(N):
  if V[i] > C[i]:
    ans += V[i] - C[i]
print(ans)


Compiler output:
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() {
  int N;
  cin>>N;
  int sum=0;
  vector<int> V(N),C(N);
  for(int i=0;i<N;i++) 
    cin>>V.at(i);
  for(int i=o;i<N;i++)
    cin>>C.at(i):
  if((V.at(i)-C.at(i))>0) 
      sum+=V.at(i)-C.at(i);
  cout<<sum<<endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:13: error: 'o' was not declared in this scope
   11 |   for(int i=o;i<N;i++)
      |             ^
a.cc:12:17: error: expected ';' before ':' token
   12 |     cin>>C.at(i):
      |                 ^
      |                 ;
Language: C++

import sys
N = int(sys.stdin.readline().strip())
Vs = map(int, sys.stdin.readline().strip().split())
Cs = map(int, sys.stdin.readline().strip().split())
max_value = 0
for v, c in zip(Vs, Cs):
    if v-c > 0:
        max_value += v-c
print(max_value)

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import sys
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

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

int main(){
    int c,ans=0;
    cin >> n;
    vector<int> v(n);
    for(int i=0;i<n;i++) cin >> v[i];
    for(int i=0;i<n;i++){
         cin >> c;
         if(v[i]-c>0)    ans+=c;
    }
    cout << ans;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: 'n' was not declared in this scope
    7 |     cin >> n;
      |            ^
Language: C++

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

int main(){
  int N;
  cin >> N;
  vector<int> V(N),C(N);
  for(int i = 0; i < N; i++){
    cin >> V[i] >> C[i];
  }
  int ans = 0;
  for(int i ~ 0; i < N; i++){
    int A = V[i] - C[i];
    if(A >= 0){
      ans += A;
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:12: error: expected ';' before '~' token
   12 |   for(int i ~ 0; i < N; i++){
      |            ^~
      |            ;
a.cc:12:23: error: expected ')' before ';' token
   12 |   for(int i ~ 0; i < N; i++){
      |      ~                ^
      |                       )
a.cc:12:25: error: 'i' was not declared in this scope
   12 |   for(int i ~ 0; i < N; i++){
      |                         ^
Language: C++


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

int main(){
  int N;
  vector<int> V(N),C(N);
  for(int i = 0; i < N; i++){
    cin >> V[i] >> C[i];
  }
  int ans = 0;
  for(int i ~ 0; i < N; i++){
    int A = V[i] - C[i];
    if(A >= 0){
      ans += A;
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:12: error: expected ';' before '~' token
   12 |   for(int i ~ 0; i < N; i++){
      |            ^~
      |            ;
a.cc:12:23: error: expected ')' before ';' token
   12 |   for(int i ~ 0; i < N; i++){
      |      ~                ^
      |                       )
a.cc:12:25: error: 'i' was not declared in this scope
   12 |   for(int i ~ 0; i < N; i++){
      |                         ^
Language: C++

#include "bits/stdc++.h"

using namespace std;

void solve(void)
{
	int n;
	cin >> n;
	int ans = 0;
	vector<int> xs(n), ys(n);
	for (int i = 0; i < n; i++)
	{
		cin >> xs[i];
	}
	for (int i = 0; i < n; i++)
	{
		cin >> ys[i];
	}
	for (int i = 0; i < n; i++)
	{
		ans += max(0, xs[i]-ys[i])
	}
	cout << ans << endl;
}

int main()
{
	solve();
	//cout << "yui(*-v・)yui" << endl;
	return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:21:43: error: expected ';' before '}' token
   21 |                 ans += max(0, xs[i]-ys[i])
      |                                           ^
      |                                           ;
   22 |         }
      |         ~
Language: C

#include<stdio.h>
int main(void){
    int a,ans;
    int value[i],cost[i];
    scanf("%d",&a);
    for(int i=0;i<a;i++){
    scanf("%d",&value[i]);
    }
    for(int i=0;i<a;i++){
    scanf("%d",&cost[i]);
    }
    ans = 0;
    for(int i=0;i<a;i++){
          if(value[i] > cost[i]) {
            ans += value[i] - cost[i];
          }
    }
 printf("%d",ans);
 return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:15: error: 'i' undeclared (first use in this function)
    4 |     int value[i],cost[i];
      |               ^
main.c:4:15: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  
  vector<int> V(N);
  vector<int> C(N);
  
  for (int i =0; i<N; ++i){
    cin >> V[i] 
  }
  for (int i = 0; i < N; ++i){
    cin >> C[i]
  }
  
  
  int ans ;
  for (int i = 0; i < N; ++i){
    if(V[i] > C[i] ){
      ans += V[i]- C[i] ;
    }
  }
  
  cout << ans << endl;
  
  
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: expected ';' before '}' token
   12 |     cin >> V[i]
      |                ^
      |                ;
   13 |   }
      |   ~             
a.cc:15:16: error: expected ';' before '}' token
   15 |     cin >> C[i]
      |                ^
      |                ;
   16 |   }
      |   ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  
  vector<int> V(N);
  vector<int> C(N);
  
  for (int i =0; i<N; ++i){
    cin >> V[i] 
  }
  for (int i = 0; i < N; ++i){
    cin >> C[i]
  
  int ans ;
  for (int i = 0; i < N; ++i){
    if(V[i] > C[i] ){
      ans += V[i]- C[i] ;
    }
  }
  
  cout << ans << endl;
  
  
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: expected ';' before '}' token
   12 |     cin >> V[i]
      |                ^
      |                ;
   13 |   }
      |   ~             
a.cc:15:16: error: expected ';' before 'int'
   15 |     cin >> C[i]
      |                ^
      |                ;
   16 | 
   17 |   int ans ;
      |   ~~~           
a.cc:20:7: error: 'ans' was not declared in this scope; did you mean 'abs'?
   20 |       ans += V[i]- C[i] ;
      |       ^~~
      |       abs
a.cc:24:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   24 |   cout << ans << endl;
      |           ^~~
      |           abs
a.cc:28:2: error: expected '}' at end of input
   28 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include<iostream>
#include<vector>

int main() {
	int n;
	vector<int> v(n);
	vector<int> c(n);
	for (int i = 0; i < n; ++i) cin >> v[i];
	for (int i = 0; i < n; ++i) cin >> c[i];

	int sum = 0;
	for (int i = 0; i < n; ++i)
		if (v[i] - c[i] > 0)sum += v[i] - c[i];


	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'vector' was not declared in this scope
    6 |         vector<int> v(n);
      |         ^~~~~~
a.cc:6:9: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:6:16: error: expected primary-expression before 'int'
    6 |         vector<int> v(n);
      |                ^~~
a.cc:7:16: error: expected primary-expression before 'int'
    7 |         vector<int> c(n);
      |                ^~~
a.cc:8:37: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |         for (int i = 0; i < n; ++i) cin >> v[i];
      |                                     ^~~
      |                                     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:8:44: error: 'v' was not declared in this scope
    8 |         for (int i = 0; i < n; ++i) cin >> v[i];
      |                                            ^
a.cc:9:37: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    9 |         for (int i = 0; i < n; ++i) cin >> c[i];
      |                                     ^~~
      |                                     std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:9:44: error: 'c' was not declared in this scope
    9 |         for (int i = 0; i < n; ++i) cin >> c[i];
      |                                            ^
a.cc:13:21: error: 'v' was not declared in this scope
   13 |                 if (v[i] - c[i] > 0)sum += v[i] - c[i];
      |                     ^
a.cc:13:28: error: 'c' was not declared in this scope
   13 |                 if (v[i] - c[i] > 0)sum += v[i] - c[i];
      |                            ^
Language: C++

#include <algorithm>
#include <functional>
#include <iostream>
#include <set>
#include <vector>

int main() {

  int N;
  int V;
  int C;

  std::vector<int> v1;
  std::vector<int> v2;

  std::cin >> N;
  for (int i = 0; i < N; i++) {
    std::cin >> V;
    v1.push_back(V);
  }

  for (int p = 0; p < N; p++) {
    std::cin >> C;
    v2.push_back(C);
  }

  std::vector<int> v3;
  for (int j = 0; j < N; j++) {
    v3.push_back(v1[j] - v2[j]);
  }

  std::sort(v3.begin(), v3.end(), std::greater<int>());

  if (N == 1) {
    std::cout << 0 << std::endl;
    return 0;
  }
  if(v4[0]<0){
    std::cout << 0 << std::endl;
    return 0;
  }
  std::vector<int> v4;
  int tmp = 0;
  for (int y = 0; y < N; y++) {
    tmp += v3[y];
    v4.push_back(tmp);
  }
    
  std::sort(v4.begin(), v4.end(), std::greater<int>());
  std::cout << v4[0] << std::endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:6: error: 'v4' was not declared in this scope; did you mean 'v3'?
   38 |   if(v4[0]<0){
      |      ^~
      |      v3
Language: C

#include<stdio.h>
#define NUM 50
int main()
{
	int N,i,a;
	int V[NUM], C[NUM],A[NUM];
	scanf_s("%d", &N);
	for (i = 0; i < N; i++) {
		scanf_s("V=%d", &V[i]);
		scanf_s("C=%d", &C[i]);
		A[i] = V[i] - C[i];
	}
	a = 0;
	for (i = 0; i < N; i++) {

		if (A[i]>0) {
			a = a + A[i];
		}
	}
	printf("%d\n", a);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    7 |         scanf_s("%d", &N);
      |         ^~~~~~~
      |         scanf
Language: C++

#include <algorithm>
#include <functional>
#include <iostream>
#include <set>
#include <vector>

int main() {

  int N;
  int V;
  int C;

  std::vector<int> v1;
  std::vector<int> v2;

  std::cin >> N;
  for (int i = 0; i < N; i++) {
    std::cin >> V;
    v1.push_back(V);
  }

  for (int p = 0; p < N; p++) {
    std::cin >> C;
    v2.push_back(C);
  }

  std::vector<int> v3;
  for (int j = 0; j < N; j++) {
    v3.push_back(v1[j] - v2[j]);
  }

  if (N == 1) {
    std::cout << 0 << std::endl;
    return 0;
  }

  std::sort(v3.begin(), v3.end(), std::greater<int>());

  std::vector<int> v4;
  int tmp = 0 for (int y = 0; y < N; y++) {
    tmp += v3[y];
    v4.push_back(tmp);
  }
  std::sort(v4.begin(), v4.end(), std::greater<int>());
  std::cout << v4[0] << std::endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:15: error: expected ',' or ';' before 'for'
   40 |   int tmp = 0 for (int y = 0; y < N; y++) {
      |               ^~~
a.cc:40:31: error: 'y' was not declared in this scope
   40 |   int tmp = 0 for (int y = 0; y < N; y++) {
      |                               ^
Language: C++

#include <iostream>
#include <set>
#include <vector>

int main() {

  int N;
  int V;
  int C;

  std::vector<int> v1;
  std::vector<int> v2;

  std::cin >> N;
  for (int i = 0; i < N; i++) {
    std::cin >> V;
    v1.push_back(V);
  }

  for (int p = 0; p < N; p++) {
    std::cin >> C;
    v2.push_back(C);
  }

  std::vector<int> v3;
  for (int j = 0; j < N; j++) {
    v3.push_back(v1[j] - v2[j]);
  }

  if (N == 1) {
    std::cout << 0 << std::endl;
    return 0;
  }

  std::sort(v3.begin(), v3.end(), std::greater<int>());

  std::vector<int> v4;
  int tmp = 0;
  for (int y = 0; y < N; y++) {
    tmp += v3[y];
    v4.push_back(v4);
  }
  std::sort(v4.begin(), v4.end(), std::greater<int>());
  std::cout << v4[0] << std::endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:8: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   35 |   std::sort(v3.begin(), v3.end(), std::greater<int>());
      |        ^~~~
      |        qsort
a.cc:41:17: error: no matching function for call to 'std::vector<int>::push_back(std::vector<int>&)'
   41 |     v4.push_back(v4);
      |     ~~~~~~~~~~~~^~~~
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:35: note:   no known conversion for argument 1 from 'std::vector<int>' to 'const std::vector<int>::value_type&' {aka 'const int&'}
 1283 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:30: note:   no known conversion for argument 1 from 'std::vector<int>' to 'std::vector<int>::value_type&&' {aka 'int&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
a.cc:43:8: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   43 |   std::sort(v4.begin(), v4.end(), std::greater<int>());
      |        ^~~~
      |        qsort
Language: C++

#include <iostream>
#include <set>
#include <vector>

int main() {

  int N;
  int V;
  int C;

  std::vector<int> v1;
  std::vector<int> v2;

  std::cin >> N;
  for (int i = 0; i < N; i++) {
    std::cin >> V;
    v1.push_back(V);
  }

  for (int p = 0; p < N; p++) {
    std::cin >> C;
    v2.push_back(C);
  }

  std::vector<int> v3;
  for (int j = 0; j < N; j++) {
    v3.push_back(v1[j] - v2[j]);
  }

  if (N == 1) {
    std::cout << 0 << std::endl;
    return 0;
  }

  std::sort(v3.begin(), v3.end(), std::greater<int>());

  std::vector<int> v4;
  int tmp = 0 for (int y = 0; y < N; y++) {
    tmp += v3[y];
    v4.push_back(v4);
  }
  std::sort(v4.begin(), v4.end(), std::greater<int>());
  std::cout << v4[0] << std::endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:8: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   35 |   std::sort(v3.begin(), v3.end(), std::greater<int>());
      |        ^~~~
      |        qsort
a.cc:38:15: error: expected ',' or ';' before 'for'
   38 |   int tmp = 0 for (int y = 0; y < N; y++) {
      |               ^~~
a.cc:38:31: error: 'y' was not declared in this scope
   38 |   int tmp = 0 for (int y = 0; y < N; y++) {
      |                               ^
a.cc:42:8: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   42 |   std::sort(v4.begin(), v4.end(), std::greater<int>());
      |        ^~~~
      |        qsort
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

int main(void) {
	int N;
	int C[20];
	int V[20];
	int deff[20];
	int sum;
	int i;
	scanf("%d", &N);
	for(i = 0; i < N; i++){
		scanf("%d ",&C[i]);
	}
	
	for(i = 0; i < N; i++){
		scanf("%d ", &V[i]);
	}
	
	for(i = 0; i < N; i++){
		deff[i] = V[i] - C[i];
		if(deff[i] > 0){
			sum += def[i];
		}
	}
	
	printf("%d\n", sum);
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:25:32: error: 'def' undeclared (first use in this function); did you mean 'deff'?
   25 |                         sum += def[i];
      |                                ^~~
      |                                deff
main.c:25:32: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

int main(void) {
	int N;
	int C[20];
	int V[20];
	int deff[20];
	int sum;
	int i;
	scanf("%d", &N);
	for(i = 0; i < N; i++){
		scanf("%d ",&C[i]);
	}
	
	for(i = 0; i < N; i++){
		scanf("%d ", &V[i]);
	}
	
	for(i = 0; i < N; i++){
		deff[i] = V[i] - C[i];
		if(def[i] > 0){
			sum += def[i];
		}
	}
	
	printf("%d\n", sum);
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:24:20: error: 'def' undeclared (first use in this function); did you mean 'deff'?
   24 |                 if(def[i] > 0){
      |                    ^~~
      |                    deff
main.c:24:20: note: each undeclared identifier is reported only once for each function it appears in
Language: C

include <stdio.h>
int main(){
	int N, Ci[20], Vi[20], i, j, X=0, Y=0, m=0;
	
	scanf("%d", &N);
	for(i=0; i<N; i++){
	 scanf("%d", &Vi);
	}
	for(i=0; i<N; i++){
	 scanf("%d", &Ci);
	}	
	
	for(i=0; i<N-1; i++){
	 for(j=i; j<N-1; j++){
	  X += Vi[j];
	  Y += Ci[j];
	  if(Y > X){
	   X -= Vi[j];
	   Y -= Ci[j];
	   continue;
	  }
	  
	  else if( (X-Y) > m){
	   m = X-Y;
	  }
	 }
	}
	printf("%d", m);
} 

Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
Language: C++

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

int main(){
	int n;
	cin >> n;
	vector<int> v(n),c(n);
	for(int i=0;i<n;i++){
		cin >> v(i);
	}
	for(int i=0;i<n;i++){
		cin >> c(i);
	}

	int ans=0;
	for(int i=0;i<n;i++){
		if(v(i)-c(i)>0){
			ans+=v(i)-c(i);
		}
	}
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:25: error: no match for call to '(std::vector<int>) (int&)'
    9 |                 cin >> v(i);
      |                        ~^~~
a.cc:12:25: error: no match for call to '(std::vector<int>) (int&)'
   12 |                 cin >> c(i);
      |                        ~^~~
a.cc:17:21: error: no match for call to '(std::vector<int>) (int&)'
   17 |                 if(v(i)-c(i)>0){
      |                    ~^~~
a.cc:17:26: error: no match for call to '(std::vector<int>) (int&)'
   17 |                 if(v(i)-c(i)>0){
      |                         ~^~~
a.cc:18:31: error: no match for call to '(std::vector<int>) (int&)'
   18 |                         ans+=v(i)-c(i);
      |                              ~^~~
a.cc:18:36: error: no match for call to '(std::vector<int>) (int&)'
   18 |                         ans+=v(i)-c(i);
      |                                   ~^~~
Language: C++

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

int main(){
    int n,v,c;

    int ans =0;


    vector <int> v(n);
      vector <int> c(n);
      cin >> n;
    for(int i=0;i<n;++i){
        cin >> v[i];
        cin >> c[i];
    }

    for(int i=0;i<n;++i){
        if(v.at(i)>=c.at(i)){
            ans += (v.at(i) - c.at(i));
        }
    }
    cout << ans <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:18: error: conflicting declaration 'std::vector<int> v'
   10 |     vector <int> v(n);
      |                  ^
a.cc:5:11: note: previous declaration as 'int v'
    5 |     int n,v,c;
      |           ^
a.cc:11:20: error: conflicting declaration 'std::vector<int> c'
   11 |       vector <int> c(n);
      |                    ^
a.cc:5:13: note: previous declaration as 'int c'
    5 |     int n,v,c;
      |             ^
a.cc:14:17: error: invalid types 'int[int]' for array subscript
   14 |         cin >> v[i];
      |                 ^
a.cc:15:17: error: invalid types 'int[int]' for array subscript
   15 |         cin >> c[i];
      |                 ^
a.cc:19:14: error: request for member 'at' in 'v', which is of non-class type 'int'
   19 |         if(v.at(i)>=c.at(i)){
      |              ^~
a.cc:19:23: error: request for member 'at' in 'c', which is of non-class type 'int'
   19 |         if(v.at(i)>=c.at(i)){
      |                       ^~
a.cc:20:23: error: request for member 'at' in 'v', which is of non-class type 'int'
   20 |             ans += (v.at(i) - c.at(i));
      |                       ^~
a.cc:20:33: error: request for member 'at' in 'c', which is of non-class type 'int'
   20 |             ans += (v.at(i) - c.at(i));
      |                                 ^~
Language: C++

#include<iostream>
using namespace std;
int bi[21];
bi[0] = 1;
for (int i = 1; i <= 20; i ++) bi[i] = bi[i - 1] * 2;
int main () {
  int N;
  cin >> N;
  int v[30];
  int c[30];
  for (int i = 0; i < N; i ++) cin >> v[i];
  for (int i = 0; i < N; i ++) cin >> c[i];
  int k[30];
  for (int i = 0; i < N; i ++) k[i] = v[i] - c[i];
  int ans = -1;
  for (int i_ = 0; i_ < bi[N - 1]; i_ ++) {
    int ko = 0;
    int i = i_;
    for (int j = 0; j < N; j ++) {
      if (i % 2) ko += k[j];
      i /= 2;
    }
    if (ans < ko) ans = ko;
  }
  cout << ans << endl;
}


Compiler output:
a.cc:4:1: error: 'bi' does not name a type
    4 | bi[0] = 1;
      | ^~
a.cc:5:1: error: expected unqualified-id before 'for'
    5 | for (int i = 1; i <= 20; i ++) bi[i] = bi[i - 1] * 2;
      | ^~~
a.cc:5:17: error: 'i' does not name a type
    5 | for (int i = 1; i <= 20; i ++) bi[i] = bi[i - 1] * 2;
      |                 ^
a.cc:5:26: error: 'i' does not name a type
    5 | for (int i = 1; i <= 20; i ++) bi[i] = bi[i - 1] * 2;
      |                          ^
Language: C++

#include<iostream>
using namespace std;
int main () {
  int bi[21];
  bi[0] = 1;
  for (int i = 1; i <= 20; i ++) bi[i] = bi[i - 1] * 2;
  int N;
  cin >> N;
  int v[30];
  int c[30];
  for (int i = 0; i < N; i ++) cin >> v[i];
  for (int i = 0; i < N; i ++) cin >> c[i];
  int k[30];
  for (int i = 0; i < N; i ++) k[i] = v[i] - c[i];
  int ans = -1;
  for (int i_ = 0; i_ < bi[N - 1]; i_ ++) {
    int ko = 0;
    int i = i_
    for (int j = 0; j < N; j ++) {
      if (i % 2) ko += k[j];
      i /= 2;
    }
    if (ans < ko) ans = ko;
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:5: error: expected ',' or ';' before 'for'
   19 |     for (int j = 0; j < N; j ++) {
      |     ^~~
a.cc:19:21: error: 'j' was not declared in this scope
   19 |     for (int j = 0; j < N; j ++) {
      |                     ^
Language: C++

#include<iostream>
using namespace std;
int bi[21];
bi[0] = 1;
for (int i = 1; i <= 20; i ++) bi[i] = bi[i - 1] * 2;
int main () {
  int bi[21];
  bi[0] = 1;
  for (int i = 1; i <= 20; i ++) bi[i] = bi[i - 1] * 2;
  int N;
  cin >> N;
  int v[30];
  int c[30];
  for (int i = 0; i < N; i ++) cin >> v[i];
  for (int i = 0; i < N; i ++) cin >> c[i];
  int k[30];
  for (int i = 0; i < N; i ++) k[i] = v[i] - c[i];
  int ans = -1;
  for (int i_ = 0; i_ < bi[N - 1]; i_ ++) {
    int ko = 0;
    int i = i_
    for (int j = 0; j < N; j ++) {
      if (i % 2) ko += k[j];
      i /= 2;
    }
    if (ans < ko) ans = ko;
  }
  cout << ans << endl;
}


Compiler output:
a.cc:4:1: error: 'bi' does not name a type
    4 | bi[0] = 1;
      | ^~
a.cc:5:1: error: expected unqualified-id before 'for'
    5 | for (int i = 1; i <= 20; i ++) bi[i] = bi[i - 1] * 2;
      | ^~~
a.cc:5:17: error: 'i' does not name a type
    5 | for (int i = 1; i <= 20; i ++) bi[i] = bi[i - 1] * 2;
      |                 ^
a.cc:5:26: error: 'i' does not name a type
    5 | for (int i = 1; i <= 20; i ++) bi[i] = bi[i - 1] * 2;
      |                          ^
a.cc: In function 'int main()':
a.cc:22:5: error: expected ',' or ';' before 'for'
   22 |     for (int j = 0; j < N; j ++) {
      |     ^~~
a.cc:22:21: error: 'j' was not declared in this scope
   22 |     for (int j = 0; j < N; j ++) {
      |                     ^
Language: C++

#include<iostream>
using namespace std;
int bi[21];
bi[0] = 1;
for (int i = 1; i <= 20; i ++) bi[i] = bi[i - 1] * 2;
int main () {
  int N;
  cin >> N;
  int v[30];
  int c[30];
  for (int i = 0; i < N; i ++) cin >> v[i];
  for (int i = 0; i < N; i ++) cin >> c[i];
  int k[30];
  for (int i = 0; i < N; i ++) k[i] = v[i] - c[i];
  int ans = -1;
  for (int i_ = 0; i_ < bi[N - 1]; i_ ++) {
    int ko = 0;
    int i = i_
    for (int j = 0; j < N; j ++) {
      if (i % 2) ko += k[j];
      i /= 2;
    }
    if (ans < ko) ans = ko;
  }
  cout << ans << endl;
}

Compiler output:
a.cc:4:1: error: 'bi' does not name a type
    4 | bi[0] = 1;
      | ^~
a.cc:5:1: error: expected unqualified-id before 'for'
    5 | for (int i = 1; i <= 20; i ++) bi[i] = bi[i - 1] * 2;
      | ^~~
a.cc:5:17: error: 'i' does not name a type
    5 | for (int i = 1; i <= 20; i ++) bi[i] = bi[i - 1] * 2;
      |                 ^
a.cc:5:26: error: 'i' does not name a type
    5 | for (int i = 1; i <= 20; i ++) bi[i] = bi[i - 1] * 2;
      |                          ^
a.cc: In function 'int main()':
a.cc:19:5: error: expected ',' or ';' before 'for'
   19 |     for (int j = 0; j < N; j ++) {
      |     ^~~
a.cc:19:21: error: 'j' was not declared in this scope
   19 |     for (int j = 0; j < N; j ++) {
      |                     ^
Language: C

#include<stdio.h>

int main(void){

  int N;
  int answer=0;
  
  scanf("%d",&N);

  int V[N];
  int C[N];
  int sa[N];

  int i;
  
  for(i=0; i<N; i++){
    scanf("%d",&V[i]);
  }

  for(i=0; i<N; i++){
    scanf("%d",&C[i]);
  }

  for(i=0; i<N; i++){
    sa[i] = V[i]-C[i];
  }
  
  for(i=0; i<N; i++){
    if(sa[i]>=0){
      answer += sa[i];
    }
  }

  printf("%d\n",answer);
  
  return 0;


Compiler output:
main.c: In function 'main':
main.c:36:3: error: expected declaration or statement at end of input
   36 |   return 0;
      |   ^~~~~~
Language: C++

#include <iostream>
using namespace std;
int main()
{
  int a;
  cin >> a;
  int v[19];
  int c[19];
  int m[19];
  int ans=0;
  for (int i=0;i<a,i++)
  {
    cin >> v[i];
  }
  for (int i=0;i<a,i++)
  {
    cin >> c[i];
  }
  for (int i=0;i<a,i++)
  {
    m[i]=v[i]-c[i];
  }
  for (int i=0;i<a,i++)
  {
    if(m[i]>0)
    {
      ans=ans+m[i];
    }
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:23: error: expected ';' before ')' token
   11 |   for (int i=0;i<a,i++)
      |                       ^
      |                       ;
a.cc:15:23: error: expected ';' before ')' token
   15 |   for (int i=0;i<a,i++)
      |                       ^
      |                       ;
a.cc:19:23: error: expected ';' before ')' token
   19 |   for (int i=0;i<a,i++)
      |                       ^
      |                       ;
a.cc:23:23: error: expected ';' before ')' token
   23 |   for (int i=0;i<a,i++)
      |                       ^
      |                       ;
Language: C++

#include <cstdio>
#include <algorithm>    
#include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <iomanip>
#include <cstring>
#include <cmath>
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long LL;
typedef long double LD;
typedef unsigned int uii;
typedef pair<int,int> pii;
typedef unsigned long long uLL; 
typedef vector<int> vii; 
//__int128
const int maxn = 2e5;
int a[maxn], v[maxn];

int main(int argc, char const *argv[])
{
#ifndef ONLINE_JUDGE
	// freopen("in.txt", "r", stdin);
	// freopen("out.txt", "w", stdout);
#endif
	int n;
	ios::sync_with_stdio(false);
	cin.tie(0);
	cin >> n;
	for(int i = 0; i < n; ++i){
		cin >> a[i];
	}
	for(int i = 0; i < n; ++i){
		cin >> v[i];
		if(a[i] - v[i] > 0){
			 res += a[i] - v[i];
		}
	}
	cout << res << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:39:26: error: 'res' was not declared in this scope
   39 |                          res += a[i] - v[i];
      |                          ^~~
a.cc:42:17: error: 'res' was not declared in this scope
   42 |         cout << res << endl;
      |                 ^~~
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main(){
  int N; cin >> N ;
  vector<int> V (N);
  for (int i = 0; i < N ; ++ i){cin >> H[i];}
  vector<int> C (N);
  for (int i = 0; i < N ; ++ i){cin >> C[i];}
  int ans=0;
  for(int i = 0;i < N;i++){if(V[i] > C[i]){ans += V[i] - C[i];}}
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:40: error: 'H' was not declared in this scope
    7 |   for (int i = 0; i < N ; ++ i){cin >> H[i];}
      |                                        ^
Language: C++

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

int main(){
  int N;
  vector<int> V; //価値
  vector<int> C; //支払い

  for(int i = 0; i < N; i++){ //入力
    cin >> V.at(i);
    cin >> C.at(i);
  }
  int a = 0;
  
  for(int j = 0; j < N; j++){
    int b = V.at(j) - C.at(j)

    if (b > 0){
      int a += b; //aに差分を加算
    }
  }
  cout << a << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:5: error: expected ',' or ';' before 'if'
   18 |     if (b > 0){
      |     ^~
Language: C++

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

int main(){
    int n;

    int ans =0;
    cin >> n;
    vector <int> c(n);
    vector <int> v(n);
    for(int i=0;i<n;++i){
        cin >> v[i];
        cin >> c[i];
    }

    for(int i=0;i<n;++i){
        if(v.at(i)>=c.at(i){
            ans += v.at(i) - c.at(i);
        }
    }
    cout << ans <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:28: error: expected ')' before '{' token
   17 |         if(v.at(i)>=c.at(i){
      |           ~                ^
      |                            )
a.cc:20:5: error: expected primary-expression before '}' token
   20 |     }
      |     ^