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

#include<stdio.h>

int main(){

     int n,*a,*b;
     int sum_a=0; int sum_b=0;
     scanf("%d\n",&n);
     if(n == 0) break;
     a=(int *)malloc(sizeof(int)*n);
     b=(int *)malloc(sizeof(int)*n);

     for(i=0;i<n;i++){
     scanf("%d %d\n",a[i],b[i]);

     if(a[i]>b[i])
     sum_a = sum_a + a[i] + b[i];
     elseif(a[i]<b[i])
     sum_b = sum_b + a[i] + b[i];
     else{
      sum_a += a[i];
      sum_b += b[i];
      } 

      } 

     printf("%d %d",sum_a,sum_b);

     return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:17: error: break statement not within loop or switch
    8 |      if(n == 0) break;
      |                 ^~~~~
main.c:9:15: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
    9 |      a=(int *)malloc(sizeof(int)*n);
      |               ^~~~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
    1 | #include<stdio.h>
  +++ |+#include <stdlib.h>
    2 | 
main.c:9:15: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
    9 |      a=(int *)malloc(sizeof(int)*n);
      |               ^~~~~~
main.c:9:15: note: include '<stdlib.h>' or provide a declaration of 'malloc'
main.c:12:10: error: 'i' undeclared (first use in this function)
   12 |      for(i=0;i<n;i++){
      |          ^
main.c:12:10: note: each undeclared identifier is reported only once for each function it appears in
main.c:17:6: error: implicit declaration of function 'elseif' [-Wimplicit-function-declaration]
   17 |      elseif(a[i]<b[i])
      |      ^~~~~~
main.c:17:23: error: expected ';' before 'sum_b'
   17 |      elseif(a[i]<b[i])
      |                       ^
      |                       ;
   18 |      sum_b = sum_b + a[i] + b[i];
      |      ~~~~~             
main.c:19:6: error: 'else' without a previous 'if'
   19 |      else{
      |      ^~~~
Language: C

#include<stdio.h>

int main(void){

     int n,i,a,b,x,y;
     scanf("%d",n);
     for(i=0;i<n;i++){
      scanf("%d %d",a,b);
      if(a>b){
        x = x + a + b;
      }
      if else(a<b){
        y = y + a + b;
      }
      else{
        x = x + a;
        y = y + b;
      }
      }
      return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:10: error: expected '(' before 'else'
   12 |       if else(a<b){
      |          ^~~~
      |          (
Language: C

#include <stdio.h>
  int main(){
   int n,h,i,apoint,bpoint;
    int a[10000],b[10000];
    for(h=0;h<10000;h++){
      a[h]=0;
       b[h]=0;
}
apoint =0;
bpoint=0;
   while(1){
    scanf("%d",&n);
     if(n==0){
      break;
}
     for(i=0;i<n;i++){
      scanf("%d %d",a[i],b[i]);
       if(a[i]<b[i]){
         apoint += a[i]+b[i];
}else if(a[i]>b[i]){
          bpoint += a[i]+b[i];
}else{
          apoint += a[i];
          bpoint += b[i];
}
printf("%d",apoint);
printf("%d\n",bpoint);
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:30:1: error: expected declaration or statement at end of input
   30 | }
      | ^
Language: C

#include <stdio.h>
  int main(){
   int n,h,i,j,x,apoint,bpoint;
    int a[10000],b[10000];
    for(h=0;h<10000;h++){
      a[h]=0;
       b[h]=0;
}
apoint=0;
bpoint=0;
   
    scanf("%d",&n);
     if(n==0){
      break;
}
     for(i=0;i<n;i++){
      scanf("%d %d",&a[i],&b[i]);
     
       if(a[i]<b[i]){
         bpoint += a[i]+b[i];
}else if(a[i]>b[i]){
          apoint += a[i]+b[i];
}else{
          apoint += a[i];
          bpoint += b[i];
}
}
printf("%d",apoint);
printf(" %d\n",bpoint);
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:7: error: break statement not within loop or switch
   14 |       break;
      |       ^~~~~
main.c: At top level:
main.c:31:1: error: expected identifier or '(' before 'return'
   31 | return 0;
      | ^~~~~~
main.c:32:1: error: expected identifier or '(' before '}' token
   32 | }
      | ^
Language: C

#include<stdio.h>

int main(){
	int game,n;
	int a,b;
	int A=0,B=0;
	int Anoten[100],Bnoten[100];

	while(1){
	if(game==0)
		return 0;
	for(n=0;n<game;n++){
		scanf("%d %d",&a,&b);
		if(a<b){
			Bnoten[n]=a+b;
			Anoten[n]=0;
		}
		else if(b<a){
			Anoten[n]=a+b;
			Bnoten[n]=0;
		}
		else{
			Anoten[n]=a;
			Bnoten[n]=b;
		}
	}
	for(n=0;n<game;n++){
	A+=Anoten[n];
	B+=Bnoten[n];
	}
	printf("%d %d\n",A,B);
	A=0,B=0;
	}
	return 0;

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

#include<stdio.h>
int main()
{
	int n,s,t,x,y;
	for(;scanf("%d",&n)&&n!=0;printf("%d %d\n",x,y))
		for(x=0,y=0;n-->0;)
		{
			scanf("%d %d",&s,&t);
			s==t?x+=s,y+=t:s>t?x+=s+t:y+=s+t;
		}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:52: error: lvalue required as left operand of assignment
    9 |                         s==t?x+=s,y+=t:s>t?x+=s+t:y+=s+t;
      |                                                    ^~
Language: C

#include <stdio.h>
int main()
{
  int n,i;
  int a[10000]={0};
  int b[10000]=(0);
  int s1;
  int s2;
  s1=0; s2=0; 
  scanf("%d",&n);
  for(i=0; i<n; i++)
  {
    if       (a[i] > b[i])  s1 += 3;
    else if(a[i]<b[i])     s2+= 3;
    else               {s1 +=1; s2+=1;}
   }
  printf("%d %d\n",s1,s2);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:16: error: invalid initializer
    6 |   int b[10000]=(0);
      |                ^
Language: C

#include <stdio.h>
int main(void){
  int cnt;
  int a,b,ind=0,j;
  int point[10000][2];
  while(1){
    scanf("%d",&cnt);
    if(cnt == 0) break;
    while(cnt-- > 0){
      scanf("%d %d",&a,&b);
      if(a > b){
        pt1 += a + b;
      }else if(a < b){
        pt2 += a + b;
      }else{
        pt1 += a; pt2 += a;
      }
    }
    point[ind][0] = pt1;
    point[ind][1] = pt2;
    ind++;
  }
  for(j = 0; j < ind;j++)
    printf("%d %d\n",point[j][0],point[j][1]);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:9: error: 'pt1' undeclared (first use in this function)
   12 |         pt1 += a + b;
      |         ^~~
main.c:12:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:9: error: 'pt2' undeclared (first use in this function)
   14 |         pt2 += a + b;
      |         ^~~
Language: C

#include<stdio.h>
int main(){
  int i,n;
  int s,t,a=0,b=0;

  scanf("%d",&a);
  for(i=1;i<=n;i++){
    scanf("%d %d",&s,&t);
    if(s>t){
      a=a+s+t;
    }else if(s<t){
      b=b+s+t;
    }else{
      a=a+t;
      b=b+s;
    }
  }
  if(a!=0){printf("%d %d\n",a,b);}

  return 0;

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

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

int main(void) {
  int n;
  vector<int> A, B;
  int i = 0. j;
  int a, b;
  for(; i < 5; i++) {
    cin >> n;
    if(!n) break;
    A.push_back(0), B.push_back(0);
    for(j = 0; i < n; i++) {
      cin >> a >> b;
      if(a > b) A[i] += a;
      else if(a < b) B[i] += b;
      else A[i] += a, B[i] += b;
  }
  for(int i = 0; i < A.size(); i++) cout << A[i] << " " << B[i] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:14: error: expected ',' or ';' before 'j'
    7 |   int i = 0. j;
      |              ^
a.cc:13:9: error: 'j' was not declared in this scope
   13 |     for(j = 0; i < n; i++) {
      |         ^
a.cc:20:2: error: expected '}' at end of input
   20 | }
      |  ^
a.cc:4:16: note: to match this '{'
    4 | int main(void) {
      |                ^
Language: C++

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

int main(void) {
  int n;
  vector<int> A, B;
  int i = 0. j;
  int a, b;
  for(; i < 5; i++) {
    cin >> n;
    if(!n) break;
    A.push_back(0), B.push_back(0);
    for(j = 0; j < n; j++) {
      cin >> a >> b;
      if(a > b) A[i] += a;
      else if(a < b) B[i] += b;
      else A[i] += a, B[i] += b;
    }
  }
  for(int i = 0; i < A.size(); i++) cout << A[i] << " " << B[i] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:14: error: expected ',' or ';' before 'j'
    7 |   int i = 0. j;
      |              ^
a.cc:13:9: error: 'j' was not declared in this scope
   13 |     for(j = 0; j < n; j++) {
      |         ^
Language: C++

def main():
    while 1:
        n = input()
        if n == 0:
            break

        sum_a = 0
        sum_b = 0
        
        for i in range(n):
            a,b = map(int, raw_input().split())

            if a > b:
                sum_a = sum_a + a + b
            elif a < b:
                sum_b = sum_b + a + b
            elif a == b:
                sum_a = sum_a + a
                sum_b = sum_b + b

        print("%s %s" %(sum_a,sum_b))
        return 0
                
if __name__ == "__main__":
    main()



Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def main():
      | ^~~
Language: C++

def main():
    while 1:
        n = input()
        if n == 0:
            break

        sum_a = 0
        sum_b = 0
        
        for i in range(n):
            a,b = map(int, raw_input().split())

            if a > b:
                sum_a = sum_a + a + b
            elif a < b:
                sum_b = sum_b + a + b
            elif a == b:
                sum_a = sum_a + a
                sum_b = sum_b + b

        print("%s %s" %(sum_a,sum_b))
    return 0
                
if __name__ == "__main__":
    main()



Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def main():
      | ^~~
Language: C++

#include<stdio.h>
int main(void)
{
	int a[10000],b[10000],n,i,c[2];
	for(;;){
		scanf("%d",&n);
		if(n==0)
			break;
		for(i=0;i<n+1;i++){
			scanf("%d%d",&a[i],&b[i]);
			if(a[i]>b[i])
				c[0]=a[i]+b[i];
			else
				c[1]=a[i]+b[i];
		}
		printf("%d %d\n"c[0],c[1]);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:24: error: unable to find string literal operator 'operator""c' with 'const char [7]', 'long unsigned int' arguments
   16 |                 printf("%d %d\n"c[0],c[1]);
      |                        ^~~~~~~~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
int n;
while(cin>>n){
int a[10000]={},b[10000]={};
int ap=0,bp=0;
	for(int i=0;i<n;i++){
	cin>>a[n]>>b[n];
	if(a[n]>b[n]){
		ap+=a[n]+b[n];
	}else if(a[n]<b[n]){
		bp+=a[n]+b[n];
	}else{
		ap+=a[n];
		bp+=b[n];
	}
	cout<<ap<<" "<<bp<<endl;
}

return 0;
}

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

#include<iostream>
using namespace std;
int main(){
int n;
int a[10000],b[10000];
while(cin>>n){
a[10000]={};
b[10000]={};
int ap=0,bp=0;
	for(int i=0;i<n;i++){
		cin>>a[n]>>b[n];
		sum=a[n]+b[n];
		if(a[n]>b[n]){
			ap+=sum;
		}else if(a[n]<b[n]){
			bp+=sum;
		}else{
			ap+=a[n];
			bp+=b[n];
		}
	}
	cout<<ap<<" "<<bp<<endl;
}

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:17: error: 'sum' was not declared in this scope
   12 |                 sum=a[n]+b[n];
      |                 ^~~
Language: C++

#include<iostream>
using namespace std;
int main(){
int n,sum;
int a,b.ap,bp;
while(cin>>n){
int ap=0,bp=0;
	for(int i=0;i<n;i++){
		cin>>a>>b;
		sum=a+b;
		if(a>b){
			ap+=sum;
		}else if(a<b){
			bp+=sum;
		}else{
			ap+=a;
			bp+=b;
		}
	}
	cout<<ap<<" "<<bp<<endl;
}

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:8: error: expected initializer before '.' token
    5 | int a,b.ap,bp;
      |        ^
a.cc:9:25: error: 'b' was not declared in this scope
    9 |                 cin>>a>>b;
      |                         ^
Language: C++

#include<iostream>
using namespace std;
int main(){
int n,sum;
int a,b.ap,bp;
while(cin>>n){
ap=0;
bp=0;
	for(int i=0;i<n;i++){
		cin>>a>>b;
		sum=a+b;
		if(a>b){
			ap+=sum;
		}else if(a<b){
			bp+=sum;
		}else{
			ap+=a;
			bp+=b;
		}
	}
	cout<<ap<<" "<<bp<<endl;
}

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:8: error: expected initializer before '.' token
    5 | int a,b.ap,bp;
      |        ^
a.cc:7:1: error: 'ap' was not declared in this scope; did you mean 'a'?
    7 | ap=0;
      | ^~
      | a
a.cc:8:1: error: 'bp' was not declared in this scope
    8 | bp=0;
      | ^~
a.cc:10:25: error: 'b' was not declared in this scope
   10 |                 cin>>a>>b;
      |                         ^
Language: C++

#include <iostream>
using namespace std;

int main()
{
  int n, x, y;
  cin >>n;
  x=0; 
  y=0;

  int a[n], b[n];
  
  for(i=1;i<=n;i++)
  {
    cin >>a[i]>>b[i];
    if(a[i]>b[i])
    {
      x += a[i]+b[i];
    }
    else if(a[i]<b[i])
    {
      y += a[i]+b[i];
    }
    else
    {
      x += a[i];
      y += b[i];
    }
  }

  cout <<x<<" "<<y<<"\n";

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:7: error: 'i' was not declared in this scope
   13 |   for(i=1;i<=n;i++)
      |       ^
Language: C++

#include <iostream>
using namespace std;
  
int main()
{
  while(1){ 
  int i, n, x, y;
  cin >>n;

  if(n=0){break;}
  x=0; 
  y=0;
  
  int a[n], b[n];
    
  for(i=1;i<=n;i++)
  {
    cin >>a[i]>>b[i];
    if(a[i]>b[i])
    {
      x += a[i]+b[i];
    }
    else if(a[i]<b[i])
    {
      y += a[i]+b[i];
    }
    else
    {
      x += a[i];
      y += b[i];
    }
  }}
  
  cout <<x<<" "<<y<<"\n";
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:10: error: 'x' was not declared in this scope
   34 |   cout <<x<<" "<<y<<"\n";
      |          ^
a.cc:34:18: error: 'y' was not declared in this scope
   34 |   cout <<x<<" "<<y<<"\n";
      |                  ^
Language: C++

#include<iostream>
using namespace std

int main () {
    int n, i,A,B, resa =0, resb =0;
    while(cin >> n,n){
        for(i=0;i<n;i++){
           　cin >> A >> B;
             (A > B)? resa +=A:resb+=B;
             if(A==B) {resa += A; resb +=B};
        }
　　　　cout << resa << " " << resb << endl;
    }
}

Compiler output:
a.cc:8:12: error: extended character 　 is not valid in an identifier
    8 |            　cin >> A >> B;
      |            ^
a.cc:12:1: error: extended character 　 is not valid in an identifier
   12 | 　　　　cout << resa << " " << resb << endl;
      | ^
a.cc:12:1: error: extended character 　 is not valid in an identifier
a.cc:12:1: error: extended character 　 is not valid in an identifier
a.cc:12:1: error: extended character 　 is not valid in an identifier
a.cc:2:20: error: expected ';' before 'int'
    2 | using namespace std
      |                    ^
      |                    ;
    3 | 
    4 | int main () {
      | ~~~                 
a.cc: In function 'int main()':
a.cc:8:12: error: '\U00003000cin' was not declared in this scope
    8 |            　cin >> A >> B;
      |            ^~~~~
a.cc:10:43: error: expected ';' before '}' token
   10 |              if(A==B) {resa += A; resb +=B};
      |                                           ^
      |                                           ;
a.cc:12:1: error: '\U00003000\U00003000\U00003000\U00003000cout' was not declared in this scope
   12 | 　　　　cout << resa << " " << resb << endl;
      | ^~~~~~~~~~~~
Language: C++

#include<iostream>
using namespace std;

int main () {
    int n, i,A,B, resa =0, resb =0;
    while(cin >> n,n){
        for(i=0;i<n;i++){
           　cin >> A >> B;
             (A > B)? resa +=A:resb+=B;
             if(A==B) {resa += A; resb +=B;};
        }
　　　　cout << resa << " " << resb << endl;
    }
}

Compiler output:
a.cc:8:12: error: extended character 　 is not valid in an identifier
    8 |            　cin >> A >> B;
      |            ^
a.cc:12:1: error: extended character 　 is not valid in an identifier
   12 | 　　　　cout << resa << " " << resb << endl;
      | ^
a.cc:12:1: error: extended character 　 is not valid in an identifier
a.cc:12:1: error: extended character 　 is not valid in an identifier
a.cc:12:1: error: extended character 　 is not valid in an identifier
a.cc: In function 'int main()':
a.cc:8:12: error: '\U00003000cin' was not declared in this scope
    8 |            　cin >> A >> B;
      |            ^~~~~
a.cc:12:1: error: '\U00003000\U00003000\U00003000\U00003000cout' was not declared in this scope
   12 | 　　　　cout << resa << " " << resb << endl;
      | ^~~~~~~~~~~~
Language: C++

#include<iostream>
using namespace std;

int main () {
    int n, i,A,B, resa =0, resb =0;
    while(cin >> n,n){
        for(i=0;i<n;i++){
           　cin >> A >> B;
             (A > B)? resa +=A:resb+=B;
             if(A==B) {resa += A; resb +=B;};
        }
    cout << resa << " " << resb << endl;
    }
}

Compiler output:
a.cc:8:12: error: extended character 　 is not valid in an identifier
    8 |            　cin >> A >> B;
      |            ^
a.cc: In function 'int main()':
a.cc:8:12: error: '\U00003000cin' was not declared in this scope
    8 |            　cin >> A >> B;
      |            ^~~~~
Language: C++

#include<iostream>
using namespace std;

int main () {
    int n, i,A,B, resa =0, resb =0;
    while(cin >> n,n){
        for(i=0;i<n;i++){
            cin >> A >> B;
            (A > B)? resa +=A:resb+=B;
            if(A==B) {resa += A; resb +=B;};
        }
　　　　cout << resa << " " << resb << endl;
    }
}

Compiler output:
a.cc:12:1: error: extended character 　 is not valid in an identifier
   12 | 　　　　cout << resa << " " << resb << endl;
      | ^
a.cc:12:1: error: extended character 　 is not valid in an identifier
a.cc:12:1: error: extended character 　 is not valid in an identifier
a.cc:12:1: error: extended character 　 is not valid in an identifier
a.cc: In function 'int main()':
a.cc:12:1: error: '\U00003000\U00003000\U00003000\U00003000cout' was not declared in this scope
   12 | 　　　　cout << resa << " " << resb << endl;
      | ^~~~~~~~~~~~
Language: C++

#include<cstdio>

using namespace std;

int main(){
	int n;
	while (1){
		int A = 0, B = 0;
		scanf_s("%d", &n);
		if (n == 0)return 0;
		for (int i = 0; i < n; i++){
			int a, b;
			scanf_s("%d %d", &a, &b);
			if (a > b){
				a += b;
				b = 0;
			}
			if (a < b){
				b += a;
				a = 0;
			}
			A += a;
			B += b;
		}
		printf("%d %d\n", A, B);
	}
}

Compiler output:
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<cstdio>

using namespace std;

int main(void){
	int n;
	while (1){
		int A = 0, B = 0;
		scanf_s("%d", &n);
		if (n == 0)return 0;
		for (int i = 0; i < n; i++){
			int a, b;
			scanf_s("%d %d", &a, &b);
			if (a > b){
				a += b;
				b = 0;
			}
			if (a < b){
				b += a;
				a = 0;
			}
			A += a;
			B += b;
		}
		printf("%d %d\n", A, B);
	}
}

Compiler output:
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 main(int ac, char** av) {
  int n, score_a = 0, score_b = 0;
  scanf("%d", &n);
  int *a = (int*) malloc(sizeof(int) * n);
  int *b = (int*) malloc(sizeof(int) * n);
  int i;
  for(i = 0; i < n; i++) {
    scanf("%d %d", a+i, b+i);
  }
  for(i = 0; i < n; i++) {
    if(a[i] > b[i]) {
      score_a += a[i] + b[i];
    } else if(a[i] < b[i]) {
      score_b += a[i] + b[i];
    } else if(a[i] == b[i]) {
      score_a += a[i];
      score_b += b[i];
    }
  }
  printf("%d %d\n", score_a, score_b);
  free(a);
  free(b);
  return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:6:19: error: 'malloc' was not declared in this scope
    6 |   int *a = (int*) malloc(sizeof(int) * n);
      |                   ^~~~~~
a.cc:2:1: note: 'malloc' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>'
    1 | #include <stdio.h>
  +++ |+#include <cstdlib>
    2 | 
a.cc:23:3: error: 'free' was not declared in this scope
   23 |   free(a);
      |   ^~~~
a.cc:23:3: note: 'free' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>'
Language: C++

#include<iostream>
using namespacee std;

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

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namespacee'
    2 | using namespacee std;
      |       ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |   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:17:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   17 |   cout<< a << " " << 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:17:27: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   17 |   cout<< a << " " << 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)
      |     ^~~~
Language: C++

#include<vector>
#include<algorithm>
#include<string>
using namespace std;

int main(){

  std::vector<std::pair<int,int> > data;

  char buf[100];
  int n;

  std::cin >> buf;
  n = atoi(buf);

  char a[100];
  char b[100];

  for (int i=0; i<n ; i++){
    std::cin >> a;
    std::cin >> b;
    data.push_back(std::pair<int,int>(atoi(a),atoi(b)));
  }

  int you = 0;
  int opp = 0;

  for (std::vector<std::pair<int,int> >::iterator it = data.begin(); it != data.end(); it++){
    int yv = (*it).first;
    int ov = (*it).second;
    if (yv > ov ){
      you += yv+ov;
    }else if (yv < ov){
      opp += yv+ov;
    }else{
      you += yv;
      opp += ov;
    }
  }

  std::cout << you << " " << opp << std::endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:8: error: 'cin' is not a member of 'std'
   13 |   std::cin >> buf;
      |        ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include<string>
  +++ |+#include <iostream>
    4 | using namespace std;
a.cc:20:10: error: 'cin' is not a member of 'std'
   20 |     std::cin >> a;
      |          ^~~
a.cc:20:10: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:21:10: error: 'cin' is not a member of 'std'
   21 |     std::cin >> b;
      |          ^~~
a.cc:21:10: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:41:8: error: 'cout' is not a member of 'std'
   41 |   std::cout << you << " " << opp << std::endl;
      |        ^~~~
a.cc:41:8: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:41:42: error: 'endl' is not a member of 'std'
   41 |   std::cout << you << " " << opp << std::endl;
      |                                          ^~~~
a.cc:4:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    3 | #include<string>
  +++ |+#include <ostream>
    4 | using namespace std;
Language: C++

#include<vector>
#include<algorithm>
#include<string>

int main(){

  std::vector<std::pair<int,int> > data;

  char buf[100];
  int n;

  std::cin >> buf;
  n = atoi(buf);

  char a[100];
  char b[100];

  for (int i=0; i<n ; i++){
    std::cin >> a;
    std::cin >> b;
    data.push_back(std::pair<int,int>(atoi(a),atoi(b)));
  }

  int you = 0;
  int opp = 0;

  for (std::vector<std::pair<int,int> >::iterator it = data.begin(); it != data.end(); it++){
    int yv = (*it).first;
    int ov = (*it).second;
    if (yv > ov ){
      you += yv+ov;
    }else if (yv < ov){
      opp += yv+ov;
    }else{
      you += yv;
      opp += ov;
    }
  }

  std::cout << you << " " << opp << std::endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:8: error: 'cin' is not a member of 'std'
   12 |   std::cin >> buf;
      |        ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include<string>
  +++ |+#include <iostream>
    4 | 
a.cc:19:10: error: 'cin' is not a member of 'std'
   19 |     std::cin >> a;
      |          ^~~
a.cc:19:10: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:20:10: error: 'cin' is not a member of 'std'
   20 |     std::cin >> b;
      |          ^~~
a.cc:20:10: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:40:8: error: 'cout' is not a member of 'std'
   40 |   std::cout << you << " " << opp << std::endl;
      |        ^~~~
a.cc:40:8: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:40:42: error: 'endl' is not a member of 'std'
   40 |   std::cout << you << " " << opp << std::endl;
      |                                          ^~~~
a.cc:4:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    3 | #include<string>
  +++ |+#include <ostream>
    4 |
Language: C++

#include<iostream>
using namespace std;
 
int main(){
	int a;
	int b[];
	int c[];
	int uma;
	int ushi;

	cin >> a;
	for (int i; i < a; i++){
		cin >> b[i];
		cin >> c[i];
	}
	for (int j; j < a; j++){
		if (b[j]>c[j]){
			uma = uma + 2;
		}
		if(b[j]=c[j]){
			uma = uma + 1;
			ushi = ushi + 1;
		}
		else{
			ushi = ushi + 2;
		}
	}
	cout << uma << ushi;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:13: error: storage size of 'b' isn't known
    6 |         int b[];
      |             ^
a.cc:7:13: error: storage size of 'c' isn't known
    7 |         int c[];
      |             ^
Language: C++

#include<iostream>
using namespace std;

int main(){
	int a;
	int uma;
	int ushi;
	int b;
	int c;
	int i;
	while (true){
		cin >> a;
		if (a == 0){ break; }
		else{
			for (i < a; i++){
				cin >> b;
				cin >> c;
				if (b>c){
					uma = uma + b + c;
				}
				if (b == c){
					uma = uma + b;
					ushi = ushi + c;
				}
				else{
					ushi = ushi + b + c;
				}
			}
		}
		cout << uma << " " << ushi << endl;
		uma = 0;
		ushi = 0;
		i = 0;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:40: error: expected ';' before ')' token
   15 |                         for (i < a; i++){
      |                                        ^
      |                                        ;
Language: C++

#include <stdio.h>

int main(){
int n,a=0,b=0;
scanf("%d",&n);
while(n){
int aa,bb;
for(int i=n,i>0;i--){
scanf("%d %d",&aa,&bb);
if(aa>bb){
a+=aa+bb;
}else if(aa<bb){
b+=aa+bb;
}else{
a+=aa;
b+=bb:
}
}
scand("%d",&n);
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: error: expected ';' before '>' token
    8 | for(int i=n,i>0;i--){
      |              ^
      |              ;
a.cc:8:14: error: expected primary-expression before '>' token
a.cc:16:6: error: expected ';' before ':' token
   16 | b+=bb:
      |      ^
      |      ;
a.cc:19:1: error: 'scand' was not declared in this scope; did you mean 'scanf'?
   19 | scand("%d",&n);
      | ^~~~~
      | scanf
Language: C++

#include <stdio.h>
 
int main(){
int n,a=0,b=0;
scanf("%d",&n);
while(n){
int aa,bb;
for(int i=n;i>0;i--){
scanf("%d %d",&aa,&bb);
if(aa>bb){
a+=aa+bb;
}else if(aa<bb){
b+=aa+bb;
}else{
a+=aa;
b+=bb:
}
}
scand("%d",&n);
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:6: error: expected ';' before ':' token
   16 | b+=bb:
      |      ^
      |      ;
a.cc:19:1: error: 'scand' was not declared in this scope; did you mean 'scanf'?
   19 | scand("%d",&n);
      | ^~~~~
      | scanf
Language: C++

#include <stdio.h>
 
int main(){
int n,a=0,b=0;
scanf("%d",&n);
while(n){
int aa,bb;
for(int i=n;i>0;i--){
scanf("%d %d",&aa,&bb);
if(aa>bb){
a+=aa+bb;
}else if(aa<bb){
b+=aa+bb;
}else{
a+=aa;
b+=bb;
}
}
scand("%d",&n);
}
}

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

#include <stdio.h>

int main(void){

 int s_num = 1;
 int sum1 = 0;
 int sum2 = 0;

 while(1){
 int i;
 scanf("%d",&s_num);
 if(s_num == 0) break;
 for(i = 0;i < s_num; i++){
  int sam1 = 0;
  int sam2 = 0;

  scanf("%d %d",&sam1,&sam2);
  
  if(sam1 > sam2){
   sum1 += (sam1 + sam2);
  }else if(sam1 < sam 2){
   sum2 += (sam1 +sam2);
  }else{
   sum1 += sam1;
   sum2 += sam2;
  }

  printf("%d %d\n",sam1.sam2);
 

 }

 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:19: error: 'sam' was not declared in this scope; did you mean 'sam2'?
   21 |   }else if(sam1 < sam 2){
      |                   ^~~
      |                   sam2
a.cc:21:22: error: expected ')' before numeric constant
   21 |   }else if(sam1 < sam 2){
      |           ~          ^~
      |                      )
a.cc:28:25: error: request for member 'sam2' in 'sam1', which is of non-class type 'int'
   28 |   printf("%d %d\n",sam1.sam2);
      |                         ^~~~
a.cc:34:2: error: expected '}' at end of input
   34 | }
      |  ^
a.cc:3:15: note: to match this '{'
    3 | int main(void){
      |               ^
Language: C++

#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<iostream>
using namespace std;
int main(void){
int n,a,b,a1,b1;
while(1){
scanf("%d",&n);
a1=0;
b1=0
if(n==0){break;}
for(int i=0;i<n;i++){
scanf("%d%d",&a,&b);
if(a>b){
a1=a+b;
}else if(b>a){
b1=a+b;
}else{
a1+=a;
b1+=b;
}
}
printf("%d %d\n",a1,b1);
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: expected ';' before 'if'
   11 | b1=0
      |     ^
      |     ;
   12 | if(n==0){break;}
      | ~~
Language: C++

#include <iostream>

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |         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:10:49: error: expected ';' before '}' token
   10 |                 else if(b>a){bpoint+=a;bpoint+=b}
      |                                                 ^
      |                                                 ;
a.cc:11:42: error: expected ';' before '}' token
   11 |                 else {apoint+=a;bpoint+=b}
      |                                          ^
      |                                          ;
a.cc:13:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   13 |         cout << apoint <<' ' << bpoint << 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:13:43: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   13 |         cout << apoint <<' ' << bpoint << 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>

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |         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:13:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   13 |         cout << apoint <<' ' << bpoint << 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:13:43: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   13 |         cout << apoint <<' ' << bpoint << 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 <stdio.h>
#include <iostream>

int main()
{
	//std::ios::
	int n;
	int a,b;
	int sa,sb;//score
	
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>a>>b;
		if(a<b){sb+=a+b;}
		else if(a>b){sa+=a+b;}
		else
		{
			sa+=a;
			sb+=b;
		}
	}
	cout<<a<<" "<<b<<"\n";
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   11 |         cin>>n;
      |         ^~~
      |         std::cin
In file included from a.cc:2:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:23:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   23 |         cout<<a<<" "<<b<<"\n";
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<math.h>

using namespace std;

int n,a,b,asum,bsum;

int main(){
	while(TRUE){
		cin>>n;
		if( n == 0 ) break;
		for(int i=0;i<n;i++){
			cin >> a >> b ;
			if( a > b ){
				asum+=(a+b);
			}else if( a == b ){
				asum+=a;
				bsum+=b;
			}else{
				bsum+=(a+b);
			}
		}
		cout<<asum<<" "<<bsum<<endl;
		asum=0;bsum=0;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:15: error: 'TRUE' was not declared in this scope
   11 |         while(TRUE){
      |               ^~~~
Language: C++

#include <iostream>
using namespace std;

int main()
{	
	while(true){
		int n,a[10000]={},b[10000]={},ascore=0,bscore=0;
		cin>>n;
		if(n==0) break;
		for(int i=0;i<n;i++){
			cin>>a[i];
			cin>>b[i];
			if(a[i]>b[i]){
				ascore+=a[i]+b[i];
			}else if(a[i]<b[i]){
				bscore+=a[i]+b[i];
			}else if(a[i]==b[i]){
				ascore+=a[i];
				bscore+=b[i];
			}
		}
	}
	cout<<ascore<<" "<<bscore<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:15: error: 'ascore' was not declared in this scope
   23 |         cout<<ascore<<" "<<bscore<<endl;
      |               ^~~~~~
a.cc:23:28: error: 'bscore' was not declared in this scope
   23 |         cout<<ascore<<" "<<bscore<<endl;
      |                            ^~~~~~
Language: C++

#include<iostream>
#include<stdio.h>
using namespace std;
int main(){
    int num;
    while(1){
        a_score=0;b_score=0;
        scanf( "%d", &num );
        if(num==0)break;
        for(int i=0;i<num;i++){
            int a_card,b_card;
            scanf("%d %d",&a_card,&b_card);
            if(a_card>b_card){a_score+=a_card+b_card;}
            else if(a_card==b_card){a_score+=a_card;b_score+=b_card;}
            else b_score+=a_card+b_card;
        } 
        cout<<a_score<<" "<<b_score<<endl;
    }
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'a_score' was not declared in this scope
    7 |         a_score=0;b_score=0;
      |         ^~~~~~~
a.cc:7:19: error: 'b_score' was not declared in this scope
    7 |         a_score=0;b_score=0;
      |                   ^~~~~~~
Language: C++

#include<iostream>
using namespace std;

int main(){
 int n;
 int Acard,Bcard,Apoint,Bpoint;
 while(true){
  cin>>n;
  if(n==0){
   break;
  }else{
    for(int i=0;i<n;i++){
     cin>>Acard>>Bcard;
     if(Acard>Bcard){
      Apoint+=Acard+Bcard;
     }else if(Acard<Bcard){
      Bpoint+=Acard+Bcard;
     }else{
      Apoint+=Acard;
      Bpoint+=Bcard;
     }
    }
   count<<Apoint<<' '<<Bpoint<<'\n';
  }
 }
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:4: error: 'count' was not declared in this scope
   23 |    count<<Apoint<<' '<<Bpoint<<'\n';
      |    ^~~~~
Language: C++

# coding: utf-8
# Here your code !


def latte():
    return int(input())

while True:
    x=y=0
    n=latte()
    if n==0 :break
    for i in range(n):
        a,b=map(int,input().strip().split())
        if a>b:
            x+=a+b
        elif b>a:
            y+=a+b
        else :
            x+=a
            y+=b
    
    print(x,y)
    
    

Compiler output:
a.cc:1:3: error: invalid preprocessing directive #coding
    1 | # coding: utf-8
      |   ^~~~~~
a.cc:2:3: error: invalid preprocessing directive #Here
    2 | # Here your code !
      |   ^~~~
a.cc:5:1: error: 'def' does not name a type
    5 | def latte():
      | ^~~
Language: C++

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

int main(){
	int n,a,b;
	long suma=0,sumb=0;
	do{
		cin >> n;
		for(int i=0;i<n;i++){
			cin >> a >> b;
			if(a>b) suma+=a+b;
			else if(a<b) sumb+=a+b;
			else{suma+=a;sumb+=b;}
		printf("%ld %ld\n",suma,sumb);
	while(n!=0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:2: error: expected '}' at end of input
   17 | }
      |  ^
a.cc:8:11: note: to match this '{'
    8 |         do{
      |           ^
a.cc:17:2: error: expected 'while' at end of input
   17 | }
      |  ^
a.cc:17:2: error: expected '(' at end of input
   17 | }
      |  ^
      |  (
a.cc:17:2: error: expected primary-expression at end of input
a.cc:17:2: error: expected ')' at end of input
   17 | }
      |  ^
      |  )
a.cc:17:2: error: expected ';' at end of input
   17 | }
      |  ^
      |  ;
a.cc:17:2: error: expected '}' at end of input
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

#include <stdio.h>

void main()
{
	int n;
	int A, B;
	int playerA = 0, playerB = 0;
	int i = 0;
	
	while (1){
		scanf("%d", &n);
		if (n == 0){
			break;
		}
		
		while (i < n){
			scanf("%d %d", &A, &B);
			if (A == B){
				playerA += A;
				playerB += B;
			}
			else if (A > B){
				playerA += A + B;
			}
			else {
				playerB += A + B;
			}
			i++;
		}
	}
}

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

#include <stdio.h>

void main()
{
	int n;
	int A, B;
	int playerA = 0, playerB = 0;
	int i = 0;
	
	while (1){
		scanf("%d", &n);
		if (n == 0){
			break;
		}
		
		while (i < n){
			scanf("%d %d", &A, &B);
			if (A == B){
				playerA += A;
				playerB += B;
			}
			else if (A > B){
				playerA += A + B;
			}
			else {
				playerB += A + B;
			}
			i++;
		}
		printf("%d %d\n", playerA, playerB);
		i = 0;
		playerA = 0;
		playerB = 0;
	}
}

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

#include<iostream>
using namespace std;
int n[10000000],s1,s2;
int main(){
int p,a,b;
cin>>p;
for(int i=0;i<p;i++){
cin>>a>>b;
if(a>b){s1+=a+b;}
else if(b>a){s2+=a+b;}
else{s1+=a;s2+=b;
}
cout<<s1<<' '<<s2<<endl
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:24: error: expected ';' before '}' token
   13 | cout<<s1<<' '<<s2<<endl
      |                        ^
      |                        ;
   14 | }
      | ~                       
a.cc:14:2: error: expected '}' at end of input
   14 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include<iostream>
using namespace std;
int n[10000000],s1,s2;
int main(){
int p,a,b;
cin>>p;
for(int i=0;i<p;i++){
cin>>a>>b;
if(a>b){s1+=a+b;}
else if(b>a){s2+=a+b;}
else{s1+=a;s2+=b;
}
cout<<s1<<' '<<s2<<endl;
}

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

#include<iostream>
#include<string>
#include<sstream>
#include<cstdlib>

using namespace std;

int main(){
	while(1){
		string str;
		getline(cin,str);
		int n = atoi(str.c_str());
		if(n==0)break;
		int scoreA = 0, scoreB = 0;
		while(n--){
			getline(cin,str)
			stringstream ss(str);
			string tmp;
			getline(ss,tmp,' ');
			int a = atoi(tmp.c_str());
			getline(ss,tmp);
			int b = atoi(tmp.c_str());
			if(a>b)scoreA+=(a+b);
			else scoreB+=(a+b);
		}
		cout<<scoreA<<" "<<scoreB<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:41: error: expected ';' before 'stringstream'
   16 |                         getline(cin,str)
      |                                         ^
      |                                         ;
   17 |                         stringstream ss(str);
      |                         ~~~~~~~~~~~~     
a.cc:19:33: error: 'ss' was not declared in this scope
   19 |                         getline(ss,tmp,' ');
      |                                 ^~
Language: C++

#include<stdio.h>
#include<iostream>
using namespace std;
int main(){
int card[100],i,j,a=0,b=0,c=1,n;
cin>>n;
while(n!=0){
for(i=0;i<2*n;i++){
cin>>card[i];
}
for(i=0;i<2*n;i=i+2){
if(card[i]>card[c]){
a=a+card[i]+card[c];
}
else if (card[i]==card[c]){
a=a+card[i];
b=b+card[c];
}
else{
b=b+card[i]+card[c];
}
c=c+2;
}
cout<<a<<" "<<b<<endl;
}
cin>>n;
}
return 0;
}

Compiler output:
a.cc:28:1: error: expected unqualified-id before 'return'
   28 | return 0;
      | ^~~~~~
a.cc:29:1: error: expected declaration before '}' token
   29 | }
      | ^
Language: C++

#include "stdafx.h"
#include <iostream>

int A[10000], B[10000];

int main()
{
	int n, a, b;
	std::cin >> n;
	while (n != 0)
	{
		a = 0; 
		b = 0;
		for (int i = 0; i < n; i++)
		{
			std::cin >> A[i] >> B[i];
			if (A[i] > B[i])
			{
				a += A[i] + B[i];
			}
			if (A[i] == B[i])
			{
				a += A[i];
				b += B[i];
			}
			if (A[i] < B[i])
			{
				b += B[i];
			}
		}
		std::cout << a << " " << b << std::endl;
		std::cin >> n;
	}
    return 0;
}

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

int main() {
	int num = 0;
	int a[10000] = { 0 };
	int	b[10000] = { 0 };
	cin >> num;
	while (num != 0) {
		int ap = 0;
		int	bp = 0;
		for (int i = 0; i < num; i++) {
			cin >> a[i] >> b[i];
			if (a[i] > b[i]) ap += a[i] + b[i];
			else if (a[i] < b[i]) bp += a[i] + b[i];
			else {
				ap += a[i];
				bp += b[i];
			}
		}
		cout << ap << " " << bp << endl;
		cin >> num;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope
    5 |         cin >> num;
      |         ^~~
a.cc:18:17: error: 'cout' was not declared in this scope
   18 |                 cout << ap << " " << bp << endl;
      |                 ^~~~
a.cc:18:44: error: 'endl' was not declared in this scope
   18 |                 cout << ap << " " << bp << endl;
      |                                            ^~~~
Language: C++

#include<stdio.h>
int main()
{
  int a,aa;
  int cou,n,i;
  while(1){
    scanf("%d",&n);
    if(n==0){
      break;
    }
    a=i/2;
    aa=n/i;
    cou=0;
    for(i=2;i<=n/2;i++){
      if((double)i%2.000000==0.000000&&(double)n%(double)i==0.000000){
	continue;
      }
      if((double)i%2.000000!=0.000000&&(double)n%(double)i!=0.000000){
	continue;
      }
      if((double)i%2.000000==0.000000&&(double)n%(double)i!=0.000000){
	cou++;
      }
      if((double)i%2.000000!=0.000000&&(double)n%(double)i==0.000000){
	cou++;
      }
    }
    printf("%d",cou);
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:19: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   15 |       if((double)i%2.000000==0.000000&&(double)n%(double)i==0.000000){
      |          ~~~~~~~~~^~~~~~~~~
      |          |         |
      |          double    double
a.cc:15:49: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   15 |       if((double)i%2.000000==0.000000&&(double)n%(double)i==0.000000){
      |                                        ~~~~~~~~~^~~~~~~~~~
      |                                        |         |
      |                                        double    double
a.cc:18:19: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   18 |       if((double)i%2.000000!=0.000000&&(double)n%(double)i!=0.000000){
      |          ~~~~~~~~~^~~~~~~~~
      |          |         |
      |          double    double
a.cc:18:49: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   18 |       if((double)i%2.000000!=0.000000&&(double)n%(double)i!=0.000000){
      |                                        ~~~~~~~~~^~~~~~~~~~
      |                                        |         |
      |                                        double    double
a.cc:21:19: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   21 |       if((double)i%2.000000==0.000000&&(double)n%(double)i!=0.000000){
      |          ~~~~~~~~~^~~~~~~~~
      |          |         |
      |          double    double
a.cc:21:49: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   21 |       if((double)i%2.000000==0.000000&&(double)n%(double)i!=0.000000){
      |                                        ~~~~~~~~~^~~~~~~~~~
      |                                        |         |
      |                                        double    double
a.cc:24:19: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   24 |       if((double)i%2.000000!=0.000000&&(double)n%(double)i==0.000000){
      |          ~~~~~~~~~^~~~~~~~~
      |          |         |
      |          double    double
a.cc:24:49: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   24 |       if((double)i%2.000000!=0.000000&&(double)n%(double)i==0.000000){
      |                                        ~~~~~~~~~^~~~~~~~~~
      |                                        |         |
      |                                        double    double
Language: C++

#include <iostream>

using namespace std;

int main(){
    int n;
    cin >> n;
    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 += b;
        }
    }
    cout << a << b << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:13: error: 'a' was not declared in this scope
   23 |     cout << a << b << endl;
      |             ^
a.cc:23:18: error: 'b' was not declared in this scope
   23 |     cout << a << b << endl;
      |                  ^