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

#include <iostream>

using namespace std;

int main
    while(0==0){
    int n;
    cin >> n;
    if(n==0) break;
    int pointA=0,pointB=0;
    for(int i=0;i<n;i++){
        int a,b;
        cin >> a >> b;
        if(a<b){
            pointB += a+b;
        }
        if(a>b){
            pointA += a+b;
        }
        else{
            pointA += a;
            pointB += a;
        }
    }
    cout << pointA <<  " " << pointB << endl;
    }
}

Compiler output:
a.cc:6:5: error: expected initializer before 'while'
    6 |     while(0==0){
      |     ^~~~~
a.cc:27:1: error: expected declaration before '}' token
   27 | }
      | ^
Language: C++

#include<iostream>

using namespace std;

int main(){
  int n;
  cin >> n;
  int a,b;
  int res_a=0,res=b=0;
  for(int i=0;i<n;i++){
    cin >> a >> b;
    if(a>b)res_a+=(a+b);
    else if(a<b)res_b+=(a+b);
    else{res_a+=a;res_b+=b;}
  }
  cout << res_a << res_b << endl;
  return 0;
}

  

Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: 'res_b' was not declared in this scope; did you mean 'res_a'?
   13 |     else if(a<b)res_b+=(a+b);
      |                 ^~~~~
      |                 res_a
a.cc:14:19: error: 'res_b' was not declared in this scope; did you mean 'res_a'?
   14 |     else{res_a+=a;res_b+=b;}
      |                   ^~~~~
      |                   res_a
a.cc:16:20: error: 'res_b' was not declared in this scope; did you mean 'res_a'?
   16 |   cout << res_a << res_b << endl;
      |                    ^~~~~
      |                    res_a
Language: C++

#include<iostream>

using namespace std;

int main(){
  int n;
  cin >> n;
  int a,b;a
  int res_a=0,res_b=0;
  for(int i=0;i<n;i++){
    cin >> a >> b;
    if(a>b) res_a+=(a+b);
    else if(a<b) res_b+=(a+b);
    else{res_a+=a;res_b+=b;}
  }
  cout << res_a << res_b << endl;
  return 0;
}

  

Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: expected ';' before 'int'
    8 |   int a,b;a
      |            ^
      |            ;
    9 |   int res_a=0,res_b=0;
      |   ~~~       
a.cc:12:13: error: 'res_a' was not declared in this scope
   12 |     if(a>b) res_a+=(a+b);
      |             ^~~~~
a.cc:13:18: error: 'res_b' was not declared in this scope
   13 |     else if(a<b) res_b+=(a+b);
      |                  ^~~~~
a.cc:14:10: error: 'res_a' was not declared in this scope
   14 |     else{res_a+=a;res_b+=b;}
      |          ^~~~~
a.cc:14:19: error: 'res_b' was not declared in this scope
   14 |     else{res_a+=a;res_b+=b;}
      |                   ^~~~~
a.cc:16:11: error: 'res_a' was not declared in this scope
   16 |   cout << res_a << res_b << endl;
      |           ^~~~~
a.cc:16:20: error: 'res_b' was not declared in this scope
   16 |   cout << res_a << res_b << endl;
      |                    ^~~~~
Language: C++

int main(void)
{
    int i,a,b,c,d,e;
	scanf("%d",&a);
	d=0; e=0;
	for(i=0;i<a;i++){
	scanf("%d %d",&b,&c);
	if(b==c){
	d+=b;
	e+=c;
	}
	else if(b>c){
	d+=b+c;
	}
	else if(b<c){
	e+=b+c;
	}
	}
	printf("%d %d\n",d,e);
	return 0;
	}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'scanf' was not declared in this scope
    4 |         scanf("%d",&a);
      |         ^~~~~
a.cc:19:9: error: 'printf' was not declared in this scope
   19 |         printf("%d %d\n",d,e);
      |         ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int main(void)
Language: C++

#include <cstdio>
#include <iostream>
#include <queue>
using namespace std;

int main(void)
{
    int i;
    int num, x, y;
    int p1 = 0;
    int p2 = 0;

    for (;;) {
        scnaf("%d", &num);
        if (num == 0) {
            break;
        }

        for (i = 0; i < num; i++) {
            scanf("%d %d", &x, &y);
            if (x > y) {
                p1 += (x+y);
            }
            else if (x < y) {
                p2 += (x+y);
            }
            else {
                p1 += x;
                p2 += y;
            }
        }
        printf("%d %d\n", p1, p2);
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'scnaf' was not declared in this scope; did you mean 'scanf'?
   14 |         scnaf("%d", &num);
      |         ^~~~~
      |         scanf
Language: C++

#include<iostream>
using namespace std;
int main(){
	int n,s1=0,s2=0,a,b;
	cin>>n;
	if(n==0)break;
	for(int i=0;i<n;i++){
		cin>>a>>b;
		if(a>b)s1+=a+b;
		else if(a<b)s2+=a+b;
		else{
			s1+=a;
			s2+=b;
		}
	}
	cout<<s1<<" "<<s2<<'\n';
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:17: error: break statement not within loop or switch
    6 |         if(n==0)break;
      |                 ^~~~~
Language: C++

#include<stdio.h>
int main()
{
	int i1, i2, b, k, n, m[2], **c, max[2], min[2];
	scanf("%d", &n);
	m[0] = n;
	m[1] = n;
	c    = new int * [2];
	c[0] = new int [n];
	c[1] = new int [n];
	for (i1 = 0; i1 < n; i1++)
		scanf("%d", &c[0][i1]);
	qsort(c[0], n, sizeof(int), compare);
	min[0] = 0;
	max[0] = n - 1;
	k = 0;
	for (i1 = 1; i1 < c[0][0]; i1++) {
		c[1][k] = i1;
		k++;
	}
	for (i1 = 0; i1 < n-1; i1++) {
		for (i2	= c[0][i1]+1; i2 < c[0][i1+1]; i2++) {
			c[1][k] = i2;
			k++;
		}
	}
	min[1] = 0;
	max[1] = n - 1;
	k       = 1;
	b       = c[0][0];
	min[0]  = 1;
	c[0][0] = 0;
	m[0]--;
	while (m[0] > 0 && m[1] > 0) {
		if (b > c[k][max[k]])
			b = -1;
		else {
			for (i1 = min[k]; i1 <= max[k]; i1++) {
				if (c[k][i1] > b) {
					b        = c[k][i1];
					c[k][i1] = 0;
					m[k]--;
					if (i1 == min[k]) {
						for (i2 = min[k]+1; i2 <= max[k]; i2++) {
							if (c[k][i2] > 0) {
								min[k] = i2;
								break;
							}
						}
					}
					else if (i1 == max[k]) {
						for (i2 = max[k]-1; i2 >= min[k]; i2--) {
							if (c[k][i2] > 0) {
								max[k] = i2;
								break;
							}
						}
					}
					break;
				}
			}
		}
		k = (k + 1) % 2;
	}
	printf("%d\n%d\n", m[1], m[0]);

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:37: error: 'compare' was not declared in this scope
   13 |         qsort(c[0], n, sizeof(int), compare);
      |                                     ^~~~~~~
a.cc:13:9: error: 'qsort' was not declared in this scope
   13 |         qsort(c[0], n, sizeof(int), compare);
      |         ^~~~~
Language: C++

#include<iostream>

void main(){

	int n;

	int a=0, b=0;

	int x, y;

	std::cin >> n;

	if (n == 0)
		goto flag;

	for(int i=0;i<n;i++){	
		std::cin >> x >> y;
		if (x > y)
			a += x + y;
		if (x < y)
			b += x + y;
		if (x == y)
			a += x, b += y;
	}

flag:

	std::cout << a << b << std::endl;

}

Compiler output:
a.cc:3:1: error: '::main' must return 'int'
    3 | void main(){
      | ^~~~
Language: C++

#include<iostream>

void main(){

	int n;

	int a=0, b=0;

	int x, y;

	f:

	std::cin >> n;

	if (n == 0)
		goto flag;

	for(int i=0;i<n;i++){	
		std::cin >> x >> y;
		if (x > y)
			a += x + y;
		if (x < y)
			b += x + y;
		if (x == y)
			a += x, b += y;
	}

	goto f;

flag:

	std::cout << a << b << std::endl;

}

Compiler output:
a.cc:3:1: error: '::main' must return 'int'
    3 | void main(){
      | ^~~~
Language: C++

#include<iostream>
int main() {
	int vec=0;
	int n;
	int a=0;
	int b=0;
	int game_a, game_b;
	while (1) {
		std::cin >> n;
		if (n == 0)break;
		else {
			for (int i = 0; i < n; ++i) {
				std::cin >> game_a>>game_b;
				if (game_a == game_b) { a += game_a; b += game_b; }
				else if (game_a > game_b)a += game_a + game_b;
				else b += game_a + game_b;
			}
			std::cout << a << " " << b << std::endl; a = ; b = 0;
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:70: error: expected primary-expression before ';' token
   18 |                         std::cout << a << " " << b << std::endl; a = ; b = 0;
      |                                                                      ^
Language: C++

#include <iostream>
using namespace std;

int main() {
	int q[10000 - 1], w[10000 - 1];
	int n;
	int a = 0;
	int b = 0;
	int x = 1;
	while (x== 10000) {
		cin >> n;
		if (n == 0) {
			break;
		}

		for (int i = 1; i <= n; ++i) {
			int c, d;
			cin >> c >> d;
			if (c == d) {
				a = a + c;
				b = b + d;
			}
			else if (c > d) {
				a = a + c + d;
			}
			else {
				b = b + c + d;
			}
		}
		q[x] = a;
		w[x] = b;
		x++;
	}
	for (int j = 1; j <= x; ++j) {
		cout << q[j] << " " << w[j] << endl;
}

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

#include <stdio.h>
#define loop(num)	for(int a = 0; a < num; a++)

int main(){
	int num;
	__int64 A = 0, B = 0;
	int a_card, b_card;
	scanf("%d", &num);
	loop(num){
		scanf("%d%d", &a_card, &b_card);
		if (a_card < b_card) B += (a_card + b_card);
		if (b_card < a_card) A += (a_card + b_card);
		if (a_card == b_card){
			A += a_card;
			B += b_card;
		}
	}
	printf("%lld %lld\n", A, B);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
    6 |         __int64 A = 0, B = 0;
      |         ^~~~~~~
      |         __int64_t
a.cc:11:38: error: 'B' was not declared in this scope
   11 |                 if (a_card < b_card) B += (a_card + b_card);
      |                                      ^
a.cc:12:38: error: 'A' was not declared in this scope
   12 |                 if (b_card < a_card) A += (a_card + b_card);
      |                                      ^
a.cc:14:25: error: 'A' was not declared in this scope
   14 |                         A += a_card;
      |                         ^
a.cc:15:25: error: 'B' was not declared in this scope
   15 |                         B += b_card;
      |                         ^
a.cc:18:31: error: 'A' was not declared in this scope
   18 |         printf("%lld %lld\n", A, B);
      |                               ^
a.cc:18:34: error: 'B' was not declared in this scope
   18 |         printf("%lld %lld\n", A, B);
      |                                  ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  int scA=0;
  int scB=0;
  while(1){
  cin>>n;
  if(n==0)break;
  for(int i=0;i<n;i++){
    int a,b;
    cin>>a>>b;
    if(a>b)scA+=a+b;
    if(a<b)scB+=a+b;
    if(a==b){
      scA+=a;
      acB+=b;
    }
  }
    cout<<scA<<' '<<scB<<endl;
  }

  return 0;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:7: error: 'acB' was not declared in this scope; did you mean 'scB'?
   17 |       acB+=b;
      |       ^~~
      |       scB
Language: C++

#include <stdio.h>

void main() {
	int n, a, b;
	int suma = 0;
	int sumb = 0;
	bool endflg = false;
	while (1) {
		scanf_s("%d", &n);
		if (n == 0) {
			return;
		}
		int i;
		for (i = n; i > 0; i--) {
			scanf_s("%d %d", &a, &b);
			if (a > b) {
				suma = suma + a + b;
			}
			else if (b > a) {
				sumb = sumb + a + b;
			}
			else {
				suma = suma + a;
				sumb = sumb + b;
			}
		}
		printf("%d %d\n", suma, sumb);
		suma = 0;
		sumb = 0;
	}
	
}

Compiler output:
a.cc:3:1: error: '::main' must return 'int'
    3 | void main() {
      | ^~~~
a.cc: In function 'int main()':
a.cc:9:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    9 |                 scanf_s("%d", &n);
      |                 ^~~~~~~
      |                 scanf
a.cc:11:25: error: return-statement with no value, in function returning 'int' [-fpermissive]
   11 |                         return;
      |                         ^~~~~~
Language: C++

#include <stdio.h>

void main() {
	int n, a, b;
	int suma = 0;
	int sumb = 0;
	bool endflg = false;
	while (1) {
		scanf_s("%d", &n);
		if (n == 0) {
			return 0;
		}
		int i;
		for (i = n; i > 0; i--) {
			scanf_s("%d %d", &a, &b);
			if (a > b) {
				suma = suma + a + b;
			}
			else if (b > a) {
				sumb = sumb + a + b;
			}
			else {
				suma = suma + a;
				sumb = sumb + b;
			}
		}
		printf("%d %d\n", suma, sumb);
		suma = 0;
		sumb = 0;
	}
	return 0;
}

Compiler output:
a.cc:3:1: error: '::main' must return 'int'
    3 | void main() {
      | ^~~~
a.cc: In function 'int main()':
a.cc:9:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    9 |                 scanf_s("%d", &n);
      |                 ^~~~~~~
      |                 scanf
Language: C++

#include <stdio.h>
int n,i,j,k;
long int A[1],B[1];
int main(){
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf(" %d %d",&j,&k);
    if(j>k){
      A[0]+=(j+k);
    } else if(j<k){
      B[0]+=(j+k)
    } else if(j==k){
      A[0]+=j;
      B[0]+=k;
    }
  }
  printf("%ld %ld\n",A[0],B[0]);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:18: error: expected ';' before '}' token
   11 |       B[0]+=(j+k)
      |                  ^
      |                  ;
   12 |     } else if(j==k){
      |     ~
Language: C++

#include <stdio.h>
int n,i,j,k;
int A[1],B[1];
int main(){
  for(;;){
    scanf("%d",&n);
    if(n==0){
      return 0;
    }
      for(i=0;i<n;i++){
      scanf(" %d %d",&j,&k);
      A[0]=0,B[0]=o;
      if(j>k){
        A[0]+=(j+k);
      } else if(j<k){
        B[0]+=(j+k);
      } else if(j==k){
        A[0]+=j;
        B[0]+=k;
      }
      printf("%d %d\n",A[0],B[0]);
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:19: error: 'o' was not declared in this scope
   12 |       A[0]=0,B[0]=o;
      |                   ^
Language: C++

#include <stdio.h>
int n,i,j,k;
int A[1]=0,B[1]=0;
int main(){
  for(;;){
    scanf("%d",&n);
    if(n==0){
      return 0;
    }
      for(i=0;i<n;i++){
      scanf(" %d %d",&j,&k);
      if(j>k){
        A[0]+=(j+k);
      } else if(j<k){
        B[0]+=(j+k);
      } else if(j==k){
        A[0]+=j;
        B[0]+=k;
      }
      printf("%d %d\n",A[0],B[0]);
      A[0]=0,B[0]=0;
    }
  }
}

Compiler output:
a.cc:3:10: error: array must be initialized with a brace-enclosed initializer
    3 | int A[1]=0,B[1]=0;
      |          ^
a.cc:3:17: error: array must be initialized with a brace-enclosed initializer
    3 | int A[1]=0,B[1]=0;
      |                 ^
Language: C++

#include<bits\stdc++.h>
using namespace std;
int main(void){
	int n,asum,bsum,a,b,i;
	while(1){
		cin>>n;
		if(n==0)break;
		asum=0; bsum=0;
		for(i=0;i<n;i++){
			cin>>a>>b;
			if(a==b)asum+=a,bsum+=b;
			if(a>b)asum+=a+b;
			if(b>a)bsum+=a+b;
		}
		cout<<asum<<' '<<bsum;
	}
	return 0;
}

Compiler output:
a.cc:1:9: fatal error: bits\stdc++.h: No such file or directory
    1 | #include<bits\stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits\stdc++.h>
using namespace std;
int main(void){
	int n,asum,bsum,a,b,i;
	while(1){
		cin>>n;
		if(n==0)break;
		asum=0; bsum=0;
		for(i=0;i<n;i++){
			cin>>a>>b;
			if(a==b)asum+=a,bsum+=b;
			if(a>b)asum+=a+b;
			if(b>a)bsum+=a+b;
		}
		cout<<asum<<' '<<bsum<<endl;
	}
	return 0;
}

Compiler output:
a.cc:1:9: fatal error: bits\stdc++.h: No such file or directory
    1 | #include<bits\stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
using namespace std;
 
int main() {
  int n, a, b, pointA, pointB;

  cin >> n;
  while(n != 0) {
    

    pointA = 0;
    pointB = 0;

    for(int i = 0; i < n; i++) {
      cin >> a >> b;
 
      if(a > b) {
        pointA += (a + b);
      } else if(a > b) {
        pointB += (a + b);
      } else {
        pointA += a;
        pointB += b;
      }

    cout << a << ' ' << b << ' ' << endl;
    cin >> n;
  }   
 
  return 0;
}
 

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

#include<iostream>
using namespace std;
int main(){
    int N,suma=0,sumb=0;
    while(N--){
        cin >> x >> y;
        if(x>y) suma=suma+x+y;
        else    sumb=sumb+x+y;
    }
    cout << suma << " " << sumb << "\n";
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:16: error: 'x' was not declared in this scope
    6 |         cin >> x >> y;
      |                ^
a.cc:6:21: error: 'y' was not declared in this scope
    6 |         cin >> x >> y;
      |                     ^
Language: C++

#include<iostream>
using namespace std;
int main(){
    int N,suma=0,sumb=0;
    cin >> N;
    while(N--){
        cin >> x >> y;
        if(x>y) suma=suma+x+y;
        else    sumb=sumb+x+y;
    }
    cout << suma << " " << sumb << "\n";
    return 0;
}

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

#include<iostream>
#include<string>
using namespase std;
int N, S, i, cnt, R, num;
string str, s;
string ring[101];
int main(){
    cin >> str >> N;
    S = str.size();
    for (i=0; i<N; i++){
        cin >> s;
        ring[i] = s + s;
    }
    cnt = 0;
    for (i=0; i<N; i++){
        R = ring[i].size();
        for (num = 0; num < R-S+1; num++){
            if( ring[i].substr(num,S) == str ){
                cnt++; break;
            }
        }
    }
    cout << cnt << endl;
   return 0;
}

Compiler output:
a.cc:3:7: error: expected nested-name-specifier before 'namespase'
    3 | using namespase std;
      |       ^~~~~~~~~
a.cc:5:1: error: 'string' does not name a type; did you mean 'stdin'?
    5 | string str, s;
      | ^~~~~~
      | stdin
a.cc:6:1: error: 'string' does not name a type; did you mean 'stdin'?
    6 | string ring[101];
      | ^~~~~~
      | stdin
a.cc: In function 'int main()':
a.cc:8:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |     cin >> str >> 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:8:12: error: 'str' was not declared in this scope; did you mean 'std'?
    8 |     cin >> str >> N;
      |            ^~~
      |            std
a.cc:11:16: error: 's' was not declared in this scope
   11 |         cin >> s;
      |                ^
a.cc:12:9: error: 'ring' was not declared in this scope
   12 |         ring[i] = s + s;
      |         ^~~~
a.cc:16:13: error: 'ring' was not declared in this scope
   16 |         R = ring[i].size();
      |             ^~~~
a.cc:23:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   23 |     cout << cnt << endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:23:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   23 |     cout << cnt << endl;
      |                    ^~~~
      |                    std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<iostream>
using namespace std;
int i, n, pA, pB, tA = 0, tB = 0;
int main () {
    whole(cin >> n) {
       if(n == 0) { break; }
       for (i=1; i<=n; i++) {
           cin >> pA >>pB;
           if (pA >pB) {
               tA += pA + pB;
           } else {
               if (pA <pB) {
                   tB += pA + pB;
               } else {
                   tA += pA;
                   tB +- pB;
               }
           }
       }
       cout << tA << " " << tB << endl;
       tA = 0; tB = 0;
     }
     return 0;
}

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

#include <iostream>
using namespace std;
int main(){ 
	int n;
	int a[3]={0};
	int b[3]={0};
	int A,B;
	for(int i=0;i<5;i++){
                cin>>n;
		if(n==0){break;}
		for(int j=0;j<n;j++){
			if(a[j]>b[j]){
				A+=a[j]+b[j];
			}
			else(a[j]<b[j]){
				B+=a[j]+b[j];
			}
		}
		cout<<A<<" "<<B<<endl;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:40: error: expected ';' before '{' token
   15 |                         else(a[j]<b[j]){
      |                                        ^
      |                                        ;
Language: C++

#include <iostream>
using namespace std;
int main(){
	int n;
	int a[3]={0};
	int b[3]={0};
	int A,B;
	for(int i=0;i<5;i++){
		cin>>n;
		if(n==0){break;}
		for(int j=0;j<n;j++){
			if(a[j]>b[j]){
				A+=a[j]+b[j];
			}
			else if(a[j]<b[j]){
				B+=a[j]+b[j];
			}
			else if(a[j]==b[j]){
				A+=a;
				B+=b;
			}
		}
		cout<<A<<" "<<B<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:34: error: invalid conversion from 'int*' to 'int' [-fpermissive]
   19 |                                 A+=a;
      |                                 ~^~~
      |                                  |
      |                                  int*
a.cc:20:34: error: invalid conversion from 'int*' to 'int' [-fpermissive]
   20 |                                 B+=b;
      |                                 ~^~~
      |                                  |
      |                                  int*
Language: C++

#include "../bits/stdc++.h"

#define X first
#define Y second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define rep(i, a, b) for (unsigned i = (a); i <= (b); ++i)
#define per(i, a, b) for (unsigned i = (a); i >= (b); --i)

using namespace std;

using I = int;
using L = long;
using F = float;
using S = string;
using LL = long long;
using VI = vector<int>;
using VL = vector<long>;
using VF = vector<float>;
using VS = vector<string>;
using PLL = pair<long, long>;
using PLF = pair<long, float>;
using PLS = pair<long, string>;
using PSL = pair<string, long>;
using PSF = pair<string, float>;
using PSS = pair<string, string>;
using MLL = map<long, long>;
using MLF = map<long, float>;
using MLS = map<long, string>;
using MSL = map<string, long>;
using MSF = map<string, float>;
using MSS = map<string, string>;

const long kMax2 = 109;
const long kMax3 = 1009;
const long kMax4 = 10009;
const long kMax5 = 100009;
const long kMax6 = 1000009;
const long kInfI = 0x3F3F3F3F;
const float kInfF = 1e15;

int main(int argc, char const *argv[]) {
  while (1) {
    L n;
    L ans1 = 0;
    L ans2 = 0;
    scanf("%ld", &n);
    if (n == 0) { break; }
    for (unsigned i = 0; i < n; i++) {
      L a, b;
      cin >> a >> b;
      if (a > b) {
        ans1 += a + b;
      } else if (a < b) {
        ans2 += a + b;
      } else {
        ans1 += a;
        ans2 += b;
      }
    }
    printf("%ld %ld\n", ans1, ans2);
  }

  return 0;
}

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

#include<iostream>
using namespace std;
int main(){
	int n;
	int a,b;
	int A,B;
	cin>>n;
	if(n=0){break;}
	for(int j=0;j<5;j++){
	for(int i=0;i<10000;i++){
		cin>>a>>b;
	if(a>b){
		A+=a+b;
	}
	else if(a<b){
		B+=a+b;
	}
	else {
		A+=a;
		B+=b;
	}
	}
	}
	cout<<A<<" "<<B<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:17: error: break statement not within loop or switch
    8 |         if(n=0){break;}
      |                 ^~~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
	int n;
	int a,b;
	int A,B;
	cin>>n;
	if(n==0){break;}
	while(true){
	for(int i=0;i<n;i++){
		cin>>a>>b;
	if(a>b){
		A+=a+b;
	}
	else if(a<b){
		B+=a+b;
	}
	else {
		A+=a;
		B+=b;
	}
	}
	}
	cout<<A<<" "<<B<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:18: error: break statement not within loop or switch
    8 |         if(n==0){break;}
      |                  ^~~~~
Language: C++

#include<stdio.h>
#include<stdlib.h>
void judge(int n, int a[], int b[], int *result1, int *result2) {
	while (--n >= 0) {
		if (a[n] > b[n]) {
			*result1 += a[n] + b[n];
		}
		else if (a[n] < b[n]) {
			*result2 += a[n] + b[n];
		}
		else if (a[n] == b[n]) {
			*result1 += a[n];
			* result2 += b[n];
		}
	}
}
int main() {
	int a[10];
	int b[10];
	int n, t = 0;
	int result1 = 0, result2 = 0;
	int result[10][2];
	do {
		scanf_s("%d", &n);
		for (int i = 0; i < n; i++) {
			scanf_s("%d %d", &a[i], &b[i]);
		}
		judge(n, a, b, &result1, &result2);
		result[t][0] = result1;
		result[t][1] = result2;
		result1 = 0;
		result2 = 0;
		t++;
	} while (n != 0);

	for (int i = 0; i < t-1;i++) {
		printf("%d %d\n", result[i][0], result[i][1]);
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   24 |                 scanf_s("%d", &n);
      |                 ^~~~~~~
      |                 scanf
Language: C++

#include<stdio.h>
void judge(int n, int a[], int b[], int *result1, int *result2) {
	while (--n >= 0) {
		if (a[n] > b[n]) {
			*result1 += a[n] + b[n];
		}
		else if (a[n] < b[n]) {
			*result2 += a[n] + b[n];
		}
		else if (a[n] == b[n]) {
			*result1 += a[n];
			* result2 += b[n];
		}
	}
}
int main() {
	int a[10];
	int b[10];
	int n, t = 0;
int i;
	int result1 = 0, result2 = 0;
	int result[10][2];
	do {
		scanf_s("%d", &n);
		for (i = 0; i < n; i++) {
			scanf_s("%d %d", &a[i], &b[i]);
		}
		judge(n, a, b, &result1, &result2);
		result[t][0] = result1;
		result[t][1] = result2;
		result1 = 0;
		result2 = 0;
		t++;
	} while (n != 0);

	for (i = 0; i < t-1;i++) {
		printf("%d %d\n", result[i][0], result[i][1]);
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   24 |                 scanf_s("%d", &n);
      |                 ^~~~~~~
      |                 scanf
Language: C++

#include<stdio.h>

int main(void){
	
	while(1){
		int n;
		int p1,p2;
		scanf("%d",&n);
		if(n==0){
			break;
		}
		p1=p2=0;
		for(int i=0;i<n;i++){
			int a,b;
			scanf("%d%d",&a,&b);
			if(a>b){
				p1+=a+b;
			}else if(a<b){
				p2+=a+b;
			}else{
				p1+=a;
				p2+=b;
			}
		}
		printf("%d %d\n",a,b);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:34: error: 'a' was not declared in this scope
   25 |                 printf("%d %d\n",a,b);
      |                                  ^
a.cc:25:36: error: 'b' was not declared in this scope
   25 |                 printf("%d %d\n",a,b);
      |                                    ^
Language: C++

main(){int n,a,b,x,y,i;for(;x=y=0,scanf("%d",&n),n;printf("%d %d\n",x,y))for(i=n;scanf("%d%d",&a,&b),i;--i)(a-b)?x+=a,y+=b:(a>b?x:y)+=a+b;}

Compiler output:
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    1 | main(){int n,a,b,x,y,i;for(;x=y=0,scanf("%d",&n),n;printf("%d %d\n",x,y))for(i=n;scanf("%d%d",&a,&b),i;--i)(a-b)?x+=a,y+=b:(a>b?x:y)+=a+b;}
      | ^~~~
a.cc: In function 'int main()':
a.cc:1:35: error: 'scanf' was not declared in this scope
    1 | main(){int n,a,b,x,y,i;for(;x=y=0,scanf("%d",&n),n;printf("%d %d\n",x,y))for(i=n;scanf("%d%d",&a,&b),i;--i)(a-b)?x+=a,y+=b:(a>b?x:y)+=a+b;}
      |                                   ^~~~~
a.cc:1:52: error: 'printf' was not declared in this scope
    1 | main(){int n,a,b,x,y,i;for(;x=y=0,scanf("%d",&n),n;printf("%d %d\n",x,y))for(i=n;scanf("%d%d",&a,&b),i;--i)(a-b)?x+=a,y+=b:(a>b?x:y)+=a+b;}
      |                                                    ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | main(){int n,a,b,x,y,i;for(;x=y=0,scanf("%d",&n),n;printf("%d %d\n",x,y))for(i=n;scanf("%d%d",&a,&b),i;--i)(a-b)?x+=a,y+=b:(a>b?x:y)+=a+b;}
Language: C++

#include<stdio.h>

int main{
	int n;
	int A=0;
	int B=0;
	int i=0;
	scanf("%d", &n);
	int x[n];
	int y[n];
	while(i<n){
	scanf("%d", &x[i]);
	scanf("%d", &y[i]);
	++i;
}
	i=0;
	while(i<n){
	if(x[i]>y[i]){
	A=A+x[i]+y[i];
}else {
	if(x[i]<y[i]){
	B=B+x[i]+y[i];
}else{
	A=A+x[i];
	B=B+y[i];
			}
		}
	++i
	}
	printf("%d %d\n", A, B);
}

Compiler output:
a.cc:3:5: error: cannot declare '::main' to be a global variable
    3 | int main{
      |     ^~~~
a.cc:4:9: error: expected primary-expression before 'int'
    4 |         int n;
      |         ^~~
a.cc:4:9: error: expected '}' before 'int'
a.cc:3:9: note: to match this '{'
    3 | int main{
      |         ^
a.cc:8:14: error: expected constructor, destructor, or type conversion before '(' token
    8 |         scanf("%d", &n);
      |              ^
a.cc:9:15: error: 'n' was not declared in this scope
    9 |         int x[n];
      |               ^
a.cc:10:15: error: 'n' was not declared in this scope
   10 |         int y[n];
      |               ^
a.cc:11:9: error: expected unqualified-id before 'while'
   11 |         while(i<n){
      |         ^~~~~
a.cc:16:9: error: 'i' does not name a type
   16 |         i=0;
      |         ^
a.cc:17:9: error: expected unqualified-id before 'while'
   17 |         while(i<n){
      |         ^~~~~
a.cc:30:15: error: expected constructor, destructor, or type conversion before '(' token
   30 |         printf("%d %d\n", A, B);
      |               ^
a.cc:31:1: error: expected declaration before '}' token
   31 | }
      | ^
Language: C++

main(n,a,b,A,B){for(;A=B=0,scanf("%d", &n),n;printf("%d %d\n",A,B))for(;n--;)scanf("%d%d",&a,&b),(a>b)?A+=a+b:(a<b)?B+=a+b:(A+=a,B+=b);}

Compiler output:
a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token
    1 | main(n,a,b,A,B){for(;A=B=0,scanf("%d", &n),n;printf("%d %d\n",A,B))for(;n--;)scanf("%d%d",&a,&b),(a>b)?A+=a+b:(a<b)?B+=a+b:(A+=a,B+=b);}
      |     ^
Language: C++

a,b,c;main(d){for(scanf("%d");scanf("%d%d",&c,&d);a+=d>c?0:c)b+=c>d?0:d;a=!printf("%d %d\n",a,b);}

Compiler output:
a.cc:1:1: error: 'a' does not name a type
    1 | a,b,c;main(d){for(scanf("%d");scanf("%d%d",&c,&d);a+=d>c?0:c)b+=c>d?0:d;a=!printf("%d %d\n",a,b);}
      | ^
a.cc:1:11: error: expected constructor, destructor, or type conversion before '(' token
    1 | a,b,c;main(d){for(scanf("%d");scanf("%d%d",&c,&d);a+=d>c?0:c)b+=c>d?0:d;a=!printf("%d %d\n",a,b);}
      |           ^
Language: C++

#include <iostream> 
#include <string> 
#include <vector> 
#include <cmath> 
#include <algorithm> 
#include <cstdlib> 

using namespace std;

void main()
{
	int n,ca,cb,A,B;

	cin>>n;
	while(n>0){
		ca=cb=A=B=0;
		for(int i=0;i<n;i++){
			cin>>ca>>cb;
			if(ca>cb) A+=ca+cb;
			else if(cb>ca) B+=ca+cb;
			else{A+=ca;B+=cb;}
		}
		cout<<A<<" "<<B<<endl;
		cin>>n;
	}

}

Compiler output:
a.cc:10:1: error: '::main' must return 'int'
   10 | void main()
      | ^~~~
Language: C++

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

int main(){
    
    while(1)
    {
        int num;
        cin>>num;
        
        if(num == 0)
        {
            break;
        }
        
        vector< int > cardA(num);
        vector< int > cardB(num);
        
        for(int i=0;i<num;++i)
        {
            int pA, pB;
            cin>>pA>>pB;
            cardA[i] = pA;
            cardB[i] = pB;
        }
        
        int pointA = 0;
        int pointB = 0;
        
        for(int i=0;i<um;++i)
        {
            if(cardA[i] ==cardB[i])
            {
                pointA += cardA[i];
                pointB += cardA[i];
            }
            else if(cardA[i] > cardB[i])
            {
                pointA += cardA[i] + cardB[i];
            }
            else
            {
                pointB += cardA[i] + cardB[i];
            }
        }
        
        cout<<pointA<<" "<<pointB<<endl;
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:23: error: 'um' was not declared in this scope; did you mean 'num'?
   31 |         for(int i=0;i<um;++i)
      |                       ^~
      |                       num
Language: C++

#include<stdio.h>

void main(){
    int n, i;
    int card[2];
    int result[2];
    result[0] = result[1] = 0;
    scanf("%d",&n);
    for(i=0;i < n;i++){
        card[0] = card[1] = 0;
        scanf("%d %d", &card[0], &card[1]);
        if(card[0] < card[1]) result[1] += card[0] + card[1];
        else if(card[0] > card[1]) result[0] += card[0] + card[1];
        else{
            result[0] += card[0];
            result[1] += card[1];
        }
    }
    printf("%d %d\n", result[0], result[1]);
    return 0;
}

Compiler output:
a.cc:3:1: error: '::main' must return 'int'
    3 | void main(){
      | ^~~~
Language: C++

a,b,c,d;main(n){for(s="%d %d\n";scanf(s+3,&n),n;printf(s,c,d))for(c=d=0;n--;*(a<b?&d:&c)+=a,*(b<a?&c:&d)+=b)scanf(s,&a,&b);}

Compiler output:
a.cc:1:1: error: 'a' does not name a type
    1 | a,b,c,d;main(n){for(s="%d %d\n";scanf(s+3,&n),n;printf(s,c,d))for(c=d=0;n--;*(a<b?&d:&c)+=a,*(b<a?&c:&d)+=b)scanf(s,&a,&b);}
      | ^
a.cc:1:13: error: expected constructor, destructor, or type conversion before '(' token
    1 | a,b,c,d;main(n){for(s="%d %d\n";scanf(s+3,&n),n;printf(s,c,d))for(c=d=0;n--;*(a<b?&d:&c)+=a,*(b<a?&c:&d)+=b)scanf(s,&a,&b);}
      |             ^
Language: C++

#include<iostream>

int main(){
int n,a,b,pa,pb;
pa=0;pb=0
cin>>n;
for(;;){
for(int i=0;i<n;i++){
cin>>a;
cin>>b;
if(a==b){pa+=a; pb+=a}
if(a>b){pa+=a+b;}
if(a<b){pb+=a+b;}
}
if(n==0){break;}
cout<<pa<<" "<<pb<<endl;
}

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:10: error: expected ';' before 'cin'
    5 | pa=0;pb=0
      |          ^
      |          ;
    6 | cin>>n;
      | ~~~       
a.cc:9:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    9 | cin>>a;
      | ^~~
      | 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:22: error: expected ';' before '}' token
   11 | if(a==b){pa+=a; pb+=a}
      |                      ^
      |                      ;
a.cc:16:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   16 | cout<<pa<<" "<<pb<<endl;
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:16:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   16 | cout<<pa<<" "<<pb<<endl;
      |                    ^~~~
      |                    std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<iostream>
using namespace std
int main(){
int n,a,b,pa,pb;
pa=0;pb=0
cin>>n;
for(;;){
for(int i=0;i<n;i++){
cin>>a;
cin>>b;
if(a==b){pa+=a; pb+=a}
if(a>b){pa+=a+b;}
if(a<b){pb+=a+b;}
}
if(n==0){break;}
cout<<pa<<" "<<pb<<endl;
}

return 0;
}

Compiler output:
a.cc:2:20: error: expected ';' before 'int'
    2 | using namespace std
      |                    ^
      |                    ;
    3 | int main(){
      | ~~~                 
a.cc: In function 'int main()':
a.cc:5:10: error: expected ';' before 'cin'
    5 | pa=0;pb=0
      |          ^
      |          ;
    6 | cin>>n;
      | ~~~       
a.cc:11:22: error: expected ';' before '}' token
   11 | if(a==b){pa+=a; pb+=a}
      |                      ^
      |                      ;
Language: C++

#include<iostream>
using namespace std;
int main(){
int n=1;
int a,b,pa,pb;
for(;n!=0;){
cin>>n;
if(n==0){break;}
pa=0;pb=0;
for(int i=0;i<n;i++){
a=0;b=0;
cin>>a;
cin>>b;
if(a>b){pa+=a+b;}
if(a==b){pa+=a;pb+=b}
if(a<b){pb+=a+b;}
}
cout<<pa<<" "<<pb<<endl;
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:21: error: expected ';' before '}' token
   15 | if(a==b){pa+=a;pb+=b}
      |                     ^
      |                     ;
Language: C++

#include <iostream>
#include <stdio.h>
using namespace std;

int main()
{

	int n;
	int a=0,=0;
	int ac,bc;

	cin >> n;

	while(n > 0){
		n--;
		cin >> ac >> bc;
		if(ac > bc)
			a += ac + bc;
		else if(ac < bc)
			b += ac + bc;
		else
			a += ac, b = bc;
	}
	printf("%d %d\n", a,b);


	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: expected unqualified-id before '=' token
    9 |         int a=0,=0;
      |                 ^
a.cc:20:25: error: 'b' was not declared in this scope; did you mean 'bc'?
   20 |                         b += ac + bc;
      |                         ^
      |                         bc
a.cc:22:34: error: 'b' was not declared in this scope; did you mean 'bc'?
   22 |                         a += ac, b = bc;
      |                                  ^
      |                                  bc
a.cc:24:29: error: 'b' was not declared in this scope; did you mean 'bc'?
   24 |         printf("%d %d\n", a,b);
      |                             ^
      |                             bc
Language: C++

#include <iostream>

int score_a, score_b;

void main(void)
{
    using namespace std;
    int n, data_a, data_b;

    while(1)
    {
        cin >> n;
        if(!n) break;
        score_a = 0;
        score_b = 0;
        for(; n > 0 ; n--) {
            cin >> data_a;
            cin >> data_b;
            if (data_a > data_b) {
                score_a += (data_a + data_b);
            } else if(data_a < data_b) {
                score_b += (data_a + data_b);
            } else {
                score_a += data_a;
                score_b += data_b;
            }
        }
        cout << score_a << " " << score_b << endl;
    }
}

Compiler output:
a.cc:5:1: error: '::main' must return 'int'
    5 | void main(void)
      | ^~~~
Language: C++

#include<iostream>
intscore_a,score_b;
intmain(void)
{
usingnamespacestd;
intn,data_a,data_b;
while(1)
{
cin>>n;
if(!n)break;
score_a=0;
score_b=0;
for(;n>0;n--){
cin>>data_a;
cin>>data_b;
if(data_a>data_b){
score_a+=(data_a+data_b);
}elseif(data_a<data_b){
score_b+=(data_a+data_b);
}else{
score_a+=data_a;
score_b+=data_b;
}
}
cout<<score_a<<""<<score_b<<endl;
}
return0;
}

Compiler output:
a.cc:2:1: error: 'intscore_a' does not name a type
    2 | intscore_a,score_b;
      | ^~~~~~~~~~
a.cc:3:1: error: ISO C++ forbids declaration of 'intmain' with no type [-fpermissive]
    3 | intmain(void)
      | ^~~~~~~
a.cc: In function 'int intmain()':
a.cc:5:1: error: 'usingnamespacestd' was not declared in this scope
    5 | usingnamespacestd;
      | ^~~~~~~~~~~~~~~~~
a.cc:6:1: error: 'intn' was not declared in this scope; did you mean 'int'?
    6 | intn,data_a,data_b;
      | ^~~~
      | int
a.cc:6:6: error: 'data_a' was not declared in this scope
    6 | intn,data_a,data_b;
      |      ^~~~~~
a.cc:6:13: error: 'data_b' was not declared in this scope
    6 | intn,data_a,data_b;
      |             ^~~~~~
a.cc:9:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    9 | 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:9:6: error: 'n' was not declared in this scope
    9 | cin>>n;
      |      ^
a.cc:11:1: error: 'score_a' was not declared in this scope
   11 | score_a=0;
      | ^~~~~~~
a.cc:12:1: error: 'score_b' was not declared in this scope
   12 | score_b=0;
      | ^~~~~~~
a.cc:18:2: error: 'elseif' was not declared in this scope
   18 | }elseif(data_a<data_b){
      |  ^~~~~~
a.cc:20:2: error: 'else' without a previous 'if'
   20 | }else{
      |  ^~~~
a.cc:25:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   25 | cout<<score_a<<""<<score_b<<endl;
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:25:29: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   25 | cout<<score_a<<""<<score_b<<endl;
      |                             ^~~~
      |                             std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:27:1: error: 'return0' was not declared in this scope
   27 | return0;
      | ^~~~~~~
a.cc:28:1: warning: no return statement in function returning non-void [-Wreturn-type]
   28 | }
      | ^
Language: C++

#include<iostream>
int score_a,score_b;
void main(void)
{
using namespace std;
int n,data_a,data_b;
while(1)
{
cin>>n;
if(!n)break;
score_a=0;
score_b=0;
for(;n>0;n--){
cin>>data_a;
cin>>data_b;
if(data_a>data_b){
score_a+=(data_a+data_b);
}else if(data_a<data_b){
score_b+=(data_a+data_b);
}else{
score_a+=data_a;
score_b+=data_b;
}
}
cout<<score_a<<" "<<score_b<<endl;
}
}

Compiler output:
a.cc:3:1: error: '::main' must return 'int'
    3 | void main(void)
      | ^~~~
Language: C++

#include<iostream>
using namespace std;

int main(){
int n,a,b;
int sumA=0,sumB=0;
while(cin>>n){
for(int i=0;i<n;i++){
cin>>a>>b;
if(a>b){
sumA+=a;
sumA+=b;
}
if(a==b){
sumA+=a;
sumB+=b;
}
if(a<b){
sumB+=a;
sumB+=b;
}}}

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

#include <stdio.h>

int N ;
int a ;
int b ;
int point[2] ;

void init ( ) ;

int main ( )
{
	while ( scanf ( "%d" , &N ) == 1 && n ) {
		init ( ) ;
		for ( int i = 0 ; i < N ; i++ ) {
			scanf ( "%d %d" , &a , &b ) ;
			if ( a > b ) {
				point[0] += ( a + b ) ;
			}
			else if ( a == b ) {
				point[0] += a ;
				point[1] += b ;
			}
			else {
				point[1] += ( a + b ) ;
			}
		}
		printf ( "%d %d\n" , point[0] , point[1] ) ;
	}
	return 0 ;
}

void init ( )
{
	point[0] = point[1] = 0 ;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:45: error: 'n' was not declared in this scope
   12 |         while ( scanf ( "%d" , &N ) == 1 && n ) {
      |                                             ^
Language: C++

#include <stdio.h>

int main(void)
{
	int ans_a, ans_b;
	int n;
	int a, b;
	
	while (1){
		scanf("%d", &n);
		if (n == 0){
			break;
		}
	ans_a = ans_b = 0;
	while (n){
		scanf("%d %d", &a, &b);
		
		if (a > b){
			ans_a += (a + b);
		}
		else if (a < b){
			ans_b += (a + b);
		}
		else {
			ans_a += a;
			ans_b += b;
		}
		
		n--;
	}
	
	printf("%d %d\n", ans_a, ans_b);
	
	return (0);
}

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

#include <iostream>
#include <string>
using namespace std;
int main(){
int n;
int a;
int b;
int c;
int d;
int e;
while(cin >>n){
c=0;
d=0;
e=0;
while(e<n){
cin >>a;
cin >>b;
if(a>b){c=c+a+b;}
if(a==b){c=c+a; d=d+b;}
if(a<b){d=d+a+b;}
e=e+1;}
cout << c <<" "<<d<<endl
}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:25: error: expected ';' before '}' token
   22 | cout << c <<" "<<d<<endl
      |                         ^
      |                         ;
   23 | }
      | ~
Language: C++

#include<cstdio>
#include<algorithm>
#include<cmath>

using namespace std;

int main(){
        while(true){
                int pa = 0, pb = 0       
                int a, b
                scanf("%d", &n);
                if(!n) break;
                for(i = 0; i < n; i++){
                        scanf("%d%d", &a, &b);
                        if(a > b)
                                pa += a + b;
                        else if(b > a)
                                pb += a + b;
                        else if(a == b){
                                pa += a;
                                pb += b;
                        }
                }
                printf("%d %d\n", pa, pb);
        }
        return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: expected ',' or ';' before 'int'
   10 |                 int a, b
      |                 ^~~
a.cc:12:21: error: 'n' was not declared in this scope; did you mean 'yn'?
   12 |                 if(!n) break;
      |                     ^
      |                     yn
a.cc:13:21: error: 'i' was not declared in this scope
   13 |                 for(i = 0; i < n; i++){
      |                     ^
a.cc:13:32: error: 'n' was not declared in this scope; did you mean 'yn'?
   13 |                 for(i = 0; i < n; i++){
      |                                ^
      |                                yn
a.cc:14:40: error: 'a' was not declared in this scope; did you mean 'pa'?
   14 |                         scanf("%d%d", &a, &b);
      |                                        ^
      |                                        pa
a.cc:14:44: error: 'b' was not declared in this scope; did you mean 'pb'?
   14 |                         scanf("%d%d", &a, &b);
      |                                            ^
      |                                            pb
Language: C++

#include<cstdio>
#include<algorithm>
#include<cmath>

using namespace std;

int main(){
        while(true){
                int pa = 0, pb = 0;      
                int a, b
                scanf("%d", &n);
                if(!n) break;
                for(i = 0; i < n; i++){
                        scanf("%d%d", &a, &b);
                        if(a > b)
                                pa += a + b;
                        else if(b > a)
                                pb += a + b;
                        else if(a == b){
                                pa += a;
                                pb += b;
                        }
                }
                printf("%d %d\n", pa, pb);
        }
        return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: expected initializer before 'scanf'
   11 |                 scanf("%d", &n);
      |                 ^~~~~
a.cc:12:21: error: 'n' was not declared in this scope
   12 |                 if(!n) break;
      |                     ^
a.cc:13:21: error: 'i' was not declared in this scope
   13 |                 for(i = 0; i < n; i++){
      |                     ^
a.cc:13:32: error: 'n' was not declared in this scope
   13 |                 for(i = 0; i < n; i++){
      |                                ^
a.cc:14:44: error: 'b' was not declared in this scope
   14 |                         scanf("%d%d", &a, &b);
      |                                            ^
Language: C++

#include<cstdio>
#include<algorithm>
#include<cmath>

using namespace std;

int main(){
        while(true){
                int pa = 0, pb = 0;      
                int a, b, n, i
                scanf("%d", &n);
                if(!n) break;
                for(i = 0; i < n; i++){
                        scanf("%d%d", &a, &b);
                        if(a > b)
                                pa += a + b;
                        else if(b > a)
                                pb += a + b;
                        else if(a == b){
                                pa += a;
                                pb += b;
                        }
                }
                printf("%d %d\n", pa, pb);
        }
        return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: expected initializer before 'scanf'
   11 |                 scanf("%d", &n);
      |                 ^~~~~
a.cc:13:21: error: 'i' was not declared in this scope
   13 |                 for(i = 0; i < n; i++){
      |                     ^
Language: C++

#include<iostream>
using namespace std;

int main()
{
 int a,b,n;
 while(cin>>n, n)
 {
  int x=0, y=0;
 while(n--)
 {
   cin>>a>>b;
   if(a<b) {y+=a+b;}
   else if(a>b) {x+=a+b;}
   else {x+=a; y+=b;}
  }
 cout<<x<<" "<<y<<endl;
}
 
 
   
  

Compiler output:
a.cc: In function 'int main()':
a.cc:18:2: error: expected '}' at end of input
   18 | }
      |  ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^