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

#include <stdio.h>
int main(void){
  int i,j,a,x,b,amari,num;
  for(i = 0; i <1000; i++){
      scanf("%d %d", &a, &b);
      if(x == 0 && y == 0) break;
      if(a < b){ 
      a = y;
      y = x;
      x = a;
      }
   num = 0;
  for(j = 0; y != 0; j++){ 
      amari = a%b;
      x = y;
      y = amari;
      j++;
  }
  printf("%d %d\n", x, num);
  }
  return 0; 
}


Compiler output:
main.c: In function 'main':
main.c:6:20: error: 'y' undeclared (first use in this function)
    6 |       if(x == 0 && y == 0) break;
      |                    ^
main.c:6:20: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
int main(void){
  int i,j,a,x,b,amari,num;
  for(i = 0; i <1000; i++){
      scanf("%d %d", &x, &y);
      if(x == 0 && y == 0) break;
      if(a < b){ 
      a = y;
      y = x;
      x = a;
      }
   num = 0;
  for(j = 0; y != 0; j++){ 
      amari = a%b;
      x = y;
      y = amari;
      j++;
  }
  printf("%d %d\n", x, num);
  }
  return 0; 
}


Compiler output:
main.c: In function 'main':
main.c:5:27: error: 'y' undeclared (first use in this function)
    5 |       scanf("%d %d", &x, &y);
      |                           ^
main.c:5:27: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
int main(void){
  int i,j,a,x,y,amari,num;
  for(i = 0; i <1000; i++){
      scanf("%d %d", &x, &y);
      if(x == 0 && y == 0) break;
      if(a < b){ 
      a = y;
      y = x;
      x = a;
      }
   num = 0;
  for(j = 0; y != 0; j++){ 
      amari = a%b;
      x = y;
      y = amari;
      j++;
  }
  printf("%d %d\n", x, num);
  }
  return 0; 
}


Compiler output:
main.c: In function 'main':
main.c:7:14: error: 'b' undeclared (first use in this function)
    7 |       if(a < b){
      |              ^
main.c:7:14: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
int main(void){
  int i,j,a,x,y,amari,num;
  for(i = 0; i <1000; i++){
      scanf("%d %d", &x, &y);
      if(x == 0 && y == 0) break;
      if(x < y){ 
      a = y;
      y = x;
      x = a;
      }
   num = 0;
  for(j = 0; y != 0; j++){ 
      amari = a%b;
      x = y;
      y = amari;
      j++;
  }
  printf("%d %d\n", x, num);
  }
  return 0; 
}


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

#include<stdio.h>
int main(void)
{
 int a,b,r,tmp;
 scanf("%d",&a);
 scanf("%d",%b);
  if(a<b){ 
   tmp = a; 
   a = b; 
   b = tmp; 
   } 
  r = a % b; 
 while(r!=0){ 
  a = b; 
  b = r; 
  r = a % b; 
 } 
 printf("最大公約数 = %d\n", b); 
 return 0;
}


Compiler output:
main.c: In function 'main':
main.c:6:13: error: expected expression before '%' token
    6 |  scanf("%d",%b);
      |             ^
Language: C

#include<stdio.h>
int main(void)
{
 int a,b,r,tmp;
 printf("1つ目の自然数 = \n");
 scanf("%d",&a);
 printf("2つ目の自然数 = \n");
 scanf("%d",%b);
  if(a<b){ 
   tmp = a; 
   a = b; 
   b = tmp; 
   } 
  r = a % b; 
 while(r!=0){ 
  a = b; 
  b = r; 
  r = a % b; 
 } 
 printf("最大公約数 = %d\n", b); 
 return 0;
}


Compiler output:
main.c: In function 'main':
main.c:8:13: error: expected expression before '%' token
    8 |  scanf("%d",%b);
      |             ^
Language: C

#include<stdio.h>
int main()
{
 int a,b,r,tmp;
 printf("1つ目の自然数 = \n");
 scanf("%d",&a);
 printf("2つ目の自然数 = \n");
 scanf("%d",%b);
  if(a<b){ 
   tmp = a; 
   a = b; 
   b = tmp; 
   } 
  r = a % b; 
 while(r!=0){ 
  a = b; 
  b = r; 
  r = a % b; 
 } 
 printf("最大公約数 = %d\n", b); 
 return 0;
}


Compiler output:
main.c: In function 'main':
main.c:8:13: error: expected expression before '%' token
    8 |  scanf("%d",%b);
      |             ^
Language: C

#include<stdio.h>
int main(void)
{
 int a,b,r,tmp;
 scanf("%d",&a);
 scanf("%d",%b);
 printf("%d %d\n",a,b)
  if(a<b){ 
   tmp = a; 
   a = b; 
   b = tmp; 
   } 
  r = a % b; 
 while(r!=0){ 
  a = b; 
  b = r; 
  r = a % b; 
 } 
 printf("%d\n", b); 
 return 0;
}


Compiler output:
main.c: In function 'main':
main.c:6:13: error: expected expression before '%' token
    6 |  scanf("%d",%b);
      |             ^
main.c:7:23: error: expected ';' before 'if'
    7 |  printf("%d %d\n",a,b)
      |                       ^
      |                       ;
    8 |   if(a<b){
      |   ~~
Language: C

#include<stdio.h>
 int main(void)
 {
 int a,b,r,tmp;
 scanf("%d",&a);
 scanf("%d",&b);
 printf("%d %d\n",a,b)
  if(a<b){
   tmp = a; a = b; b = tmp;
  }
 r = a % b;
  while(r!=0){
   a = b; b = r; r = a % b;
  }
 printf("%d\n", b);

 return 0;
} 


Compiler output:
main.c: In function 'main':
main.c:7:23: error: expected ';' before 'if'
    7 |  printf("%d %d\n",a,b)
      |                       ^
      |                       ;
    8 |   if(a<b){
      |   ~~
Language: C

#include <stdio.h>
int main(void)
{
int=a,b,c,r,tmp;
scanf("%d %d",&a,&b);

c=a*b;

if(a<b){
    tmp = a; 
    a = b; 
    b = tmp; 
 } 

r=a%b;
while(r!=0)
{
 a=b;
 b=r;
 r=a%b;
}
printf("%d %d",b,a);
return 0;
}


Compiler output:
main.c: In function 'main':
main.c:4:4: error: expected identifier or '(' before '=' token
    4 | int=a,b,c,r,tmp;
      |    ^
main.c:5:16: error: 'a' undeclared (first use in this function)
    5 | scanf("%d %d",&a,&b);
      |                ^
main.c:5:16: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:19: error: 'b' undeclared (first use in this function)
    5 | scanf("%d %d",&a,&b);
      |                   ^
main.c:7:1: error: 'c' undeclared (first use in this function)
    7 | c=a*b;
      | ^
main.c:10:5: error: 'tmp' undeclared (first use in this function)
   10 |     tmp = a;
      |     ^~~
main.c:15:1: error: 'r' undeclared (first use in this function)
   15 | r=a%b;
      | ^
Language: C

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

 // ユークリッドの互除法を利用した、最大公約数を求める関数
 int gcd(int a, int b)
 {
     int c;

     if (a < b) {
         a+=b; b=a-b; a-=b;
     }

     while (b != 0) {
         c = a % b;
         a = b;
         b = c;
　　count++;
     }

     return a;
 }

 int main(void)
 {
     int a, b;

     scanf("%d %d", &a, &b);

     if (a <= 0 || b <= 0) {
         exit(EXIT_FAILURE );
     }

     printf("%d %d\n", gcd(a, b),count);

     return EXIT_SUCCESS;
 }


Compiler output:
main.c: In function 'gcd':
main.c:17:1: error: stray '\343' in program
   17 | <U+3000><U+3000>count++;
      | ^~~~~~~~
main.c:17:3: error: stray '\343' in program
   17 | <U+3000><U+3000>count++;
      |         ^~~~~~~~
main.c:17:5: error: 'count' undeclared (first use in this function)
   17 | 　　count++;
      |     ^~~~~
main.c:17:5: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'main':
main.c:33:34: error: 'count' undeclared (first use in this function)
   33 |      printf("%d %d\n", gcd(a, b),count);
      |                                  ^~~~~
Language: C

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

 // ユークリッドの互除法を利用した、最大公約数を求める関数
 int gcd(int a, int b)
 {
     int c,count;

     if (a < b) {
         a+=b; b=a-b; a-=b;
     }

     while (b != 0) {
         c = a % b;
         a = b;
         b = c;
　　count++;
     }

     return a;
 }

 int main(void)
 {
     int a, b;

     scanf("%d %d", &a, &b);

     if (a <= 0 || b <= 0) {
         exit(EXIT_FAILURE );
     }

     printf("%d %d\n", gcd(a, b),count);

     return EXIT_SUCCESS;
 }


Compiler output:
main.c: In function 'gcd':
main.c:17:1: error: stray '\343' in program
   17 | <U+3000><U+3000>count++;
      | ^~~~~~~~
main.c:17:3: error: stray '\343' in program
   17 | <U+3000><U+3000>count++;
      |         ^~~~~~~~
main.c: In function 'main':
main.c:33:34: error: 'count' undeclared (first use in this function)
   33 |      printf("%d %d\n", gcd(a, b),count);
      |                                  ^~~~~
main.c:33:34: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

 // ユークリッドの互除法を利用した、最大公約数を求める関数
 int gcd(int a, int b)
 {
     int c,count;

     if (a < b) {
         a+=b; b=a-b; a-=b;
     }

     while (b != 0) {
         c = a % b;
         a = b;
         b = c;
　　count+=;
     }

     return a;
 }

 int main(void)
 {
     int a, b;

     scanf("%d %d", &a, &b);

     if (a <= 0 || b <= 0) {
         exit(EXIT_FAILURE );
     }

     printf("%d %d\n", gcd(a, b),count);

     return EXIT_SUCCESS;
 }


Compiler output:
main.c: In function 'gcd':
main.c:17:1: error: stray '\343' in program
   17 | <U+3000><U+3000>count+=;
      | ^~~~~~~~
main.c:17:3: error: stray '\343' in program
   17 | <U+3000><U+3000>count+=;
      |         ^~~~~~~~
main.c:17:12: error: expected expression before ';' token
   17 | 　　count+=;
      |            ^
main.c: In function 'main':
main.c:33:34: error: 'count' undeclared (first use in this function)
   33 |      printf("%d %d\n", gcd(a, b),count);
      |                                  ^~~~~
main.c:33:34: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
 int main(void)
 {
 int a,b,r,tmp;
 scanf("%d",&a);
 scanf("%d",&b);
 printf("%d %d\n",a,b)
  if(a<b){
   tmp = a; a = b; b = tmp;
  }
 r = a % b;
  while(r!=0){
   a = b; b = r; r = a % b;
  }
 printf("%d\n", b);

 return 0;
}


Compiler output:
main.c: In function 'main':
main.c:7:23: error: expected ';' before 'if'
    7 |  printf("%d %d\n",a,b)
      |                       ^
      |                       ;
    8 |   if(a<b){
      |   ~~
Language: C

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

int gcd(int a, int b) {
   int r;
   while((r = a % b) != 0)
   {
       a = b;
       b = r;
   }
   return b;
}

int main(void){
   int a, b, tmp;
   if (a < b){
       tmp = b;
       b = a;
       a = tmp;
   }
   while(cin >> a >> b) {
     int lcm = a * b / gcd(a,b);
     cout << gcd(a,b) << " " << lcm << endl;
   }
   return 0;
}




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

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

int gcd(float a, float b) {
   float r;
   while((r = a % b) != 0)
   {
       a = b;
       b = r;
   }
   return b;
}

int main(void){
   float a, b, tmp;
   if (a < b){
       tmp = b;
       b = a;
       a = tmp;
   }
   while(cin >> a >> b) {
     int lcm = a * b / gcd(a,b);
     cout << gcd(a,b) << " " << lcm << endl;
   }
   return 0;
}




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

#include <iostream>
#include <cstdio>
using namespace std;
int counter;
int gcd(int a, int b){
        if (b == 0)
 return a; 
       counter++; 
       return gcd(b, a%b);
    }
int main(void){ 
   int a, b; 
    while(cin>>a>>b){ 
       if(a == 0 && b == 0)
    return 0; 
       counter = 0; 
       cout<<gcd(a,b)<<"
       "<<counter<<endl;
     }
     return 0;}


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



#include<stdio.h>
#define
 SWAP(type,a,b)do{
type temp=a;
a=b;b=temp;
}
while(0)
 int main(){
 int a,b,i,cnt;
 while(1){
 scanf("%d %d",&a,&b);
 if(a==0&&b==0) return 0;
 if(a<b)SWAP(int,a,b);
 cnt=0; 
while(b!=0){
 a%=b; SWAP(int,a,b); cnt++;
 }
 printf("%d %d\n",a,cnt);
 }
 } 



  

 



 



Compiler output:
main.c:4:8: error: no macro name given in #define directive
    4 | #define
      |        ^
main.c:5:2: error: return type defaults to 'int' [-Wimplicit-int]
    5 |  SWAP(type,a,b)do{
      |  ^~~~
main.c: In function 'SWAP':
main.c:5:16: error: expected declaration specifiers before 'do'
    5 |  SWAP(type,a,b)do{
      |                ^~
main.c:9:1: error: expected declaration specifiers before 'while'
    9 | while(0)
      | ^~~~~
main.c:5:2: error: type of 'type' defaults to 'int' [-Wimplicit-int]
    5 |  SWAP(type,a,b)do{
      |  ^~~~
main.c:5:2: error: type of 'a' defaults to 'int' [-Wimplicit-int]
main.c:5:2: error: type of 'b' defaults to 'int' [-Wimplicit-int]
main.c:34: error: expected '{' at end of input
Language: C

#include<stdio.h> #define SWAP(type,a,b)do{type temp=a;a=b;b=temp;}while(0) int main(){ int a,b,i,cnt; while(1){ scanf("%d %d",&a,&b); if(a==0&&b==0) return 0; if(a<b)SWAP(int,a,b); cnt=0; while(b!=0){ a%=b; SWAP(int,a,b); cnt++; } printf("%d %d\n",a,cnt); } } 


Compiler output:
main.c:1:19: warning: extra tokens at end of #include directive
    1 | #include<stdio.h> #define SWAP(type,a,b)do{type temp=a;a=b;b=temp;}while(0) int main(){ int a,b,i,cnt; while(1){ scanf("%d %d",&a,&b); if(a==0&&b==0) return 0; if(a<b)SWAP(int,a,b); cnt=0; while(b!=0){ a%=b; SWAP(int,a,b); cnt++; } printf("%d %d\n",a,cnt); } }
      |                   ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C

#include <stdio.h>

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


Compiler output:
main.c: In function 'main':
main.c:16:23: error: expected ';' before ')' token
   16 |         for(i = 0; i++){
      |                       ^
      |                       ;
Language: C

R(x,y,c){y?R(y,x%y,c-1):x&&printf("%d %d\n",x,-c);}main(x,y){for(;~scanf("%d%d",&x,&y);)R(x,y,x<y);

Compiler output:
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
    1 | R(x,y,c){y?R(y,x%y,c-1):x&&printf("%d %d\n",x,-c);}main(x,y){for(;~scanf("%d%d",&x,&y);)R(x,y,x<y);
      | ^
main.c: In function 'R':
main.c:1:1: error: type of 'x' defaults to 'int' [-Wimplicit-int]
main.c:1:1: error: type of 'y' defaults to 'int' [-Wimplicit-int]
main.c:1:1: error: type of 'c' defaults to 'int' [-Wimplicit-int]
main.c:1:28: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    1 | R(x,y,c){y?R(y,x%y,c-1):x&&printf("%d %d\n",x,-c);}main(x,y){for(;~scanf("%d%d",&x,&y);)R(x,y,x<y);
      |                            ^~~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'
  +++ |+#include <stdio.h>
    1 | R(x,y,c){y?R(y,x%y,c-1):x&&printf("%d %d\n",x,-c);}main(x,y){for(;~scanf("%d%d",&x,&y);)R(x,y,x<y);
main.c:1:28: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
    1 | R(x,y,c){y?R(y,x%y,c-1):x&&printf("%d %d\n",x,-c);}main(x,y){for(;~scanf("%d%d",&x,&y);)R(x,y,x<y);
      |                            ^~~~~~
main.c:1:28: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c: At top level:
main.c:1:52: error: return type defaults to 'int' [-Wimplicit-int]
    1 | R(x,y,c){y?R(y,x%y,c-1):x&&printf("%d %d\n",x,-c);}main(x,y){for(;~scanf("%d%d",&x,&y);)R(x,y,x<y);
      |                                                    ^~~~
main.c: In function 'main':
main.c:1:52: error: type of 'x' defaults to 'int' [-Wimplicit-int]
main.c:1:52: error: type of 'y' defaults to 'int' [-Wimplicit-int]
main.c:1:68: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    1 | R(x,y,c){y?R(y,x%y,c-1):x&&printf("%d %d\n",x,-c);}main(x,y){for(;~scanf("%d%d",&x,&y);)R(x,y,x<y);
      |                                                                    ^~~~~
main.c:1:68: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:68: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
main.c:1:68: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:1: error: expected declaration or statement at end of input
    1 | R(x,y,c){y?R(y,x%y,c-1):x&&printf("%d %d\n",x,-c);}main(x,y){for(;~scanf("%d%d",&x,&y);)R(x,y,x<y);
      | ^
Language: C

#include<stdio.h>
int main(void){
	
	int i,tmp,x,y,step=0;
	
	for(j=0;;j++){
		scanf("%d %d",&x,&y);
		if(x==0&&y==0){
			break;
		}
		for(i=0;;i++){
			x=x%y;
			
			tmp=x;
			x=y;
			y=tmp;
			
			step++;
			if(y==0){
				break;
			}
		}
	}
	printf("%d %d\n",x,step);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:13: error: 'j' undeclared (first use in this function)
    6 |         for(j=0;;j++){
      |             ^
main.c:6:13: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<iostream>
using namespace std;
int main() {
	int a, b,r, kouyaku[1001], kazu[1001],kaisuu,s;
	kaisuu = 0;
	while (1) {
		cin >> a >> b;
		if (a == 0&&b == 0) {
			goto a;
		}
		kaisuu = kaisuu + 1;
		s = 0;

	a:;
	for (int i = 1; i <= kaisuu; i++) {
		cout << kouyaku[i]<<" " << kazu[i] << endl;
	}
}


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

include<iostream>
using namespace std;
int main() {
	int a, b, r, kouyaku[1001], kazu[1001], kaisuu, s;
	kaisuu = 0;
	while (1) {
		cin >> a >> b;
		if (a == 0 && b == 0) {
			goto a;
		}
		kaisuu = kaisuu + 1;
		s = 0;
	}
	a:;
		for (int i = 1; i <= kaisuu; i++) {
			cout << kouyaku[i] << " " << kazu[i] << endl;
		}
	
}


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:17: error: 'cin' was not declared in this scope
    7 |                 cin >> a >> b;
      |                 ^~~
a.cc:16:25: error: 'cout' was not declared in this scope
   16 |                         cout << kouyaku[i] << " " << kazu[i] << endl;
      |                         ^~~~
a.cc:16:65: error: 'endl' was not declared in this scope
   16 |                         cout << kouyaku[i] << " " << kazu[i] << endl;
      |                                                                 ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
int gcd(int a,int b){
	 if(b==0)return a;
	 return gcd(b,a%b);
 }
int main(){
	int a,b;
	while(1){
		cin>>a>>b;
		if(a==0&&b==0)break;
		cout<<gdc(a,b)<<endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:23: error: 'gdc' was not declared in this scope; did you mean 'gcd'?
   13 |                 cout<<gdc(a,b)<<endl;
      |                       ^~~
      |                       gcd
Language: C++

#include<iostream>

using namespace std;

typedef long long int;

int ct=0;

int gcd(int a,int b){
	ct++;
	if(a%b==0)return b;
	return gcd(b,a%b);
}

int main(){
	int x,y;
	while(cin>>x>>y,x==0&&y==0){
		if(x<y){
			int tmp=x;
			x=y;
			y=tmp;
		}
		cout<<gcd(x,y)<<" "<<ct<<endl;
		ct=0;
	}
	return 0;
}

Compiler output:
a.cc:5:19: error: declaration does not declare anything [-fpermissive]
    5 | typedef long long int;
      |                   ^~~
Language: C++

#include <cstdio>
int ans = 0;
int GCD(int a, int b){
	if(b==0)return a;
	ans++;
	return GCD(b, a%b);
}

int main(){
	int x,y;
	while(scanf("%d %d",&x, &y), x+y){
		ans=0;
		if(x<y)std::swap(x,y);
		int gcd = GCD(x,y);
		printf("%d %d\n",gcd, ans);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:29: error: 'swap' is not a member of 'std'
   13 |                 if(x<y)std::swap(x,y);
      |                             ^~~~
Language: C++

#include <cstdio>
int ans = 0;
int GCD(int a, int b){
	if(b==0)return a;
	ans++;
	return GCD(b, a%b);
}

int main(){
	int x,y;
	while(scanf("%d %d",&x, &y), x+y){
		ans=0;
		if(x<y)swap(x,y);
		int gcd = GCD(x,y);
		printf("%d %d\n",gcd, ans);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:24: error: 'swap' was not declared in this scope
   13 |                 if(x<y)swap(x,y);
      |                        ^~~~
Language: C++

#include <iostream>
using namespace std;
 
int gcd(int a, int b, int step);
 
int main()
{
    int a, b;
 
    while (cin >> a >> b, a){
        gcd(a, b, 0);
    }
 
    return (0);
}
 
void gcd(int a, int b, int step)
{
    if (b == 0){
        cout << a << " " << step << endl;
    }
    else if (a < b){
        return (gcd(a, b % a, step + 1));
    }
    else {
        return (gcd(b, a % b, step + 1));
    }
}

Compiler output:
a.cc:17:6: error: ambiguating new declaration of 'void gcd(int, int, int)'
   17 | void gcd(int a, int b, int step)
      |      ^~~
a.cc:4:5: note: old declaration 'int gcd(int, int, int)'
    4 | int gcd(int a, int b, int step);
      |     ^~~
a.cc: In function 'void gcd(int, int, int)':
a.cc:23:20: error: return-statement with a value, in function returning 'void' [-fpermissive]
   23 |         return (gcd(a, b % a, step + 1));
      |                ~~~~^~~~~~~~~~~~~~~~~~~~~
a.cc:26:20: error: return-statement with a value, in function returning 'void' [-fpermissive]
   26 |         return (gcd(b, a % b, step + 1));
      |                ~~~~^~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<stdio.h>
int main(void)
{
    int n,m,i,a;
	while(1){
	    scanf("%d %d",&n,&m);
		if(n==0&&m==0) break;
		a=0;
		if(n<m){
		i=n;
		n=m;
		m=i;
		while(1){
		    i=n%m;
			n=m;
			m=i;
			a++;
			if(m==0) break;
		}
		printf("%d %d\n",n,a);
	}
	return 0;
}

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

#include <iostream>
#include <algorithm>
using namespace std;
int main(){
	int x,y;
	while(cin>>x){
		cin>>y;
		if(x==0&&y==0)break;
		int cnt=0;
		while(true){
			if(y==0)break;
			x=x%y;
			swap(x,y);
			cnt++;
		}
		cout<<x<<" "<<cnt<<endl;
	}
	return 0;
}
}

Compiler output:
a.cc:20:1: error: expected declaration before '}' token
   20 | }
      | ^
Language: C++

#include <stdio.h>
int main(void) {
	long a1, a2, x, y;
	int amari,i=0;
	scanf("%ld %ld", &a1, &a2);	//1. 2number
	
	
	if(a1<a2){
		
		x = a2;
		y = a1;
	}	
	for(amari =! 0){
		amari = x % y;
		x = y;
		y = amari;
                i++;
	
	}
	
	printf("%ld %ld\n", x, i);
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:23: error: expected ';' before ')' token
   13 |         for(amari =! 0){
      |                       ^
      |                       ;
a.cc:23:9: error: expected primary-expression before 'return'
   23 |         return 0;
      |         ^~~~~~
a.cc:21:35: error: expected ')' before 'return'
   21 |         printf("%ld %ld\n", x, i);
      |                                   ^
      |                                   )
   22 | 
   23 |         return 0;
      |         ~~~~~~                     
a.cc:13:12: note: to match this '('
   13 |         for(amari =! 0){
      |            ^
Language: C++

#include <stdio.h>
int main(void) {
	long a1, a2, x, y;
	int amari,i=0;
	scanf("%ld %ld", &a1, &a2);	//1. 2number
	if(m==0 && n==0)break;
	
	if(a1<a2){
		
		x = a2;
		y = a1;
	}	
	for(amari =! 0){
		amari = x % y;
		x = y;
		y = amari;
                i++;
	
	}
	
	printf("%ld %ld\n", x, i);
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:12: error: 'm' was not declared in this scope
    6 |         if(m==0 && n==0)break;
      |            ^
a.cc:6:20: error: 'n' was not declared in this scope
    6 |         if(m==0 && n==0)break;
      |                    ^
a.cc:6:25: error: break statement not within loop or switch
    6 |         if(m==0 && n==0)break;
      |                         ^~~~~
a.cc:13:23: error: expected ';' before ')' token
   13 |         for(amari =! 0){
      |                       ^
      |                       ;
a.cc:23:9: error: expected primary-expression before 'return'
   23 |         return 0;
      |         ^~~~~~
a.cc:21:35: error: expected ')' before 'return'
   21 |         printf("%ld %ld\n", x, i);
      |                                   ^
      |                                   )
   22 | 
   23 |         return 0;
      |         ~~~~~~                     
a.cc:13:12: note: to match this '('
   13 |         for(amari =! 0){
      |            ^
Language: C++

#include <stdio.h>
int main(void) {
	long a1, a2, x, y;
	int amari,i=0;
	scanf("%ld %ld", &a1, &a2);	//1. 2number
	if(m==0 && n==0)break;
	
	if(a1<a2){
		
		x = a2;
		y = a1;
	}	
	while(amari =! 0){
		amari = x % y;
		x = y;
		y = amari;
                i++;
	
	}
	
	printf("%ld %ld\n", x, i);
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:12: error: 'm' was not declared in this scope
    6 |         if(m==0 && n==0)break;
      |            ^
a.cc:6:20: error: 'n' was not declared in this scope
    6 |         if(m==0 && n==0)break;
      |                    ^
a.cc:6:25: error: break statement not within loop or switch
    6 |         if(m==0 && n==0)break;
      |                         ^~~~~
Language: C++

#include <stdio.h>
int main(void) {
	long a1, a2, x, y;
	int amari,i=0;
	scanf("%ld %ld", &a1, &a2);	//1. 2number
	if(a1==0 && a2==0)break;
	
	if(a1<a2){
		
		x = a2;
		y = a1;
	}	
	while(amari =! 0){
		amari = x % y;
		x = y;
		y = amari;
                i++;
	
	}
	
	printf("%ld %ld\n", x, i);
	
	return 0;
}


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

#include <iostream>

using namespace std;

int counter;

int gcd(int a, int b){
       if (b == 0) return a;
       counter++;
       else return gcd(b, a%b);
   }

int main(void){
   int a, b;
    while(cin>>a>>b){
       if(a == 0 && b == 0)    return 0;
       counter = 0;
       cout<<gcd(a,b)<<" "<<counter<<endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:10:8: error: 'else' without a previous 'if'
   10 |        else return gcd(b, a%b);
      |        ^~~~
Language: C++

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

int gcd(int a, int b){
       if (b == 0) return a;
       else return gcd(b, a%b)
       counter++;
   }

int main(void){
   int counter;
   int a, b;
    while(cin>>a>>b){
       if(a == 0 && b == 0)    return 0;
       counter = 0;
       cout<<gcd(a,b)<<" "<<counter<<endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:7:31: error: expected ';' before 'counter'
    7 |        else return gcd(b, a%b)
      |                               ^
      |                               ;
    8 |        counter++;
      |        ~~~~~~~                 
a.cc:8:8: error: 'counter' was not declared in this scope
    8 |        counter++;
      |        ^~~~~~~
Language: C++

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

int gcd(int a, int b){
       if (b == 0) return a;
       else return gcd(b, a%b);
       counter++;
   }

int main(void){
   int counter;
   int a, b;
    while(cin>>a>>b){
       if(a == 0 && b == 0)    return 0;
       counter = 0;
       cout<<gcd(a,b)<<" "<<counter<<endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:8:8: error: 'counter' was not declared in this scope
    8 |        counter++;
      |        ^~~~~~~
Language: C++

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

int counter;

int gcd(int a, int b){
       if (b == 0) return a;
       else return gcd(b, a%b);
       counter++;
   }

int main(void){
   int a, b;
    while(cin>>a>>b){
    if(a < b){
           x = a;
           a = b;
           b = x;
       }
       if(a == 0 && b == 0)    return 0;
       counter = 0;
       cout<<gcd(a,b)<<" "<<counter<<endl;
    }
    return 0;
}


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

#include <iostream>
#include <cstdio>
using namespace std;
int gcd(int a, int b){
       if (b == 0) return a;
       else return gcd(b, a%b);
       counter++;
   }

int main(void){
   int a, b, counter;
    while(cin>>a>>b){
    if(a < b){
           x = a;
           a = b;
           b = x;
       }
       if(a == 0 && b == 0)    return 0;
       counter = 0;
       cout<<gcd(a,b)<<" "<<counter<<endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:7:8: error: 'counter' was not declared in this scope
    7 |        counter++;
      |        ^~~~~~~
a.cc: In function 'int main()':
a.cc:14:12: error: 'x' was not declared in this scope
   14 |            x = a;
      |            ^
Language: C++

#include <iostream>
using namespace std;
int gcd(int a, int b){
       if (b == 0) return a;
       else return gcd(b, a%b);
       counter++;
   }

int main(void){
   int a, b, counter;
    while(cin>>a>>b){
    if(a < b){
           x = a;
           a = b;
           b = x;
       }
       if(a == 0 && b == 0)    return 0;
       counter = 0;
       cout<<gcd(a,b)<<" "<<counter<<endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:6:8: error: 'counter' was not declared in this scope
    6 |        counter++;
      |        ^~~~~~~
a.cc: In function 'int main()':
a.cc:13:12: error: 'x' was not declared in this scope
   13 |            x = a;
      |            ^
Language: C++

#include <iostream>
using namespace std;
   int gcd(int a, int b){
       if (b == 0) return a;
       else return gcd(b, a%b);
       counter++;
   }

int main(void){
   int a, b, counter;
    while(cin>>a>>b){
    if(a < b){
           x = a;
           a = b;
           b = x;
       }
       if(a == 0 && b == 0)    return 0;
       counter = 0;
       cout<<gcd(a,b)<<" "<<counter<<endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:6:8: error: 'counter' was not declared in this scope
    6 |        counter++;
      |        ^~~~~~~
a.cc: In function 'int main()':
a.cc:13:12: error: 'x' was not declared in this scope
   13 |            x = a;
      |            ^
Language: C++

#include <iostream>
using namespace std;
int counter;
   int gcd(int a, int b){
       if (b == 0) return a;
       else return gcd(b, a%b);
       counter++;
   }

int main(void){
   int a, b, counter;
    while(cin>>a>>b){
    if(a < b){
           x = a;
           a = b;
           b = x;
       }
       if(a == 0 && b == 0)    return 0;
       counter = 0;
       cout<<gcd(a,b)<<" "<<counter<<endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:12: error: 'x' was not declared in this scope
   14 |            x = a;
      |            ^
Language: C++

#include <iostream>
#include <cstdio>using namespace std;
int counter;
int gcd(int a, int b)
{       if (b == 0) return a;
       counter++;
       return gcd(b, a%b);
   }
int main(void){
   int a, b, x;
    while(cin>>a>>b){
        if(a < b){
            x = a;
            a = b;
            b = x;
        }
        if(a == 0 && b == 0)
    return 0;
        counter = 0;
        cout<<gcd(a,b)<<' ’;
       cout<<counter<<endl;
    }
    return 0;


Compiler output:
a.cc:2:24: warning: extra tokens at end of #include directive
    2 | #include <cstdio>using namespace std;
      |                        ^~~~~~~~~
a.cc:2:10: fatal error: cstdio>usin: No such file or directory
    2 | #include <cstdio>using namespace std;
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

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


int count = 0;

int gcd(int x,int y){
  count++;
  if(y == 0)return x;
  gcd(y,x%y);
}

int main(){

while(1){
  int x,y;
  cin >> x >> y;
  if(x == 0 && y == 0)break;

  cout << gcd(x,y) << " " << count << endl;

}
  return 0;
}



Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:8:3: error: reference to 'count' is ambiguous
    8 |   count++;
      |   ^~~~~
In file included from /usr/include/c++/14/algorithm:86,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
  101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~~
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:4025:5: note:                 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
 4025 |     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
      |     ^~~~~
a.cc:5:5: note:                 'int count'
    5 | int count = 0;
      |     ^~~~~
a.cc: In function 'int main()':
a.cc:20:30: error: reference to 'count' is ambiguous
   20 |   cout << gcd(x,y) << " " << count << endl;
      |                              ^~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
  101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~~
/usr/include/c++/14/bits/stl_algo.h:4025:5: note:                 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
 4025 |     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
      |     ^~~~~
a.cc:5:5: note:                 'int count'
    5 | int count = 0;
      |     ^~~~~
a.cc: In function 'int gcd(int, int)':
a.cc:10:6: warning: control reaches end of non-void function [-Wreturn-type]
   10 |   gcd(y,x%y);
      |   ~~~^~~~~~~
Language: C++

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

int main(){
	while(1){
	int a,b,c;
	cin>>a>>b;
	if(a==0 && b==0){break;}
	c=0;
	t=0;
	int count=0;
	while(b!=0){
	c=a%b;
	a=c;
	swap(a,b);

	count++;
	}
	cout<<a<<" "<<count<<endl;
	}
}


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

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

int main(){

  int x,y,x1,y1;
  int cnt=0;

  while(1)
    {
      cin >> x >> y;

      if(x==0 && y==0)
	{
	  break;
	}

      /* x = max(x,y);
	 y = min(x,y);*/

      while(1)
	{
	  if(x!=y)
	    {
	      y1 = x%y;
	      x1 = y;
	      cnt++;
	      x = x1;
	      y = y1;
	      if(y == 0)break;
	    }
	  else
	    {
	      cnt = 1;
	      break;
	    } 
	}
      cout << x << " " << cnt << endl;
    }



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

#include<vector>
#include<algorithm>
#include<cstdio>
#include <string>
#include <complex>
#include <functional>
using namespace std;
typedef pair<int,int> P;
double dat[100][100];
double dp[200][100];//動的計画法
int main(){
    long long a,b,cnt,tmp;
    while(cin>>a>>b,a){
        cnt=0;
        if(a<b){
            tmp=b;
            b=a;
            a=tmp;
        }
        while(b){
            a%=b;
            tmp=b;
            b=a;
            a=tmp;
            cnt++;
        }
        cout<<a<<" "<<cnt<<endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:11: error: 'cin' was not declared in this scope
   13 |     while(cin>>a>>b,a){
      |           ^~~
a.cc:7:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    6 | #include <functional>
  +++ |+#include <iostream>
    7 | using namespace std;
a.cc:27:9: error: 'cout' was not declared in this scope
   27 |         cout<<a<<" "<<cnt<<endl;
      |         ^~~~
a.cc:27:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

(){
  int a[2];
  while(cin>>a[0]>>a[1]){
    if ( a[0]==0&&a[1]==0)break;
    if ( a[0]<a[1])swap(a[0],a[1]);
    solve(a);
  }
}

Compiler output:
a.cc:1:2: error: expected unqualified-id before ')' token
    1 | (){
      |  ^
Language: C

#include <stdio.h>
#include <string.h>
??
int main()
{
????????int i0, i1, i2, i3, n, m, d[30][6], s[30], sw;
????????char c[8];
????????char color[6][8] = {"Cyan", "Yellow", "Red", "Magenta", "Green", "Blue"};
??
????????scanf("%d", &n);
????????while (n > 0) {
????????????????for (i0 = 0; i0 < n; i0++) {
????????????????????????for (i1 = 0; i1 < 6; i1++) {
????????????????????????????????scanf("%s", c);
????????????????????????????????for (i2 = 0; i2 < 6; i2++) {
????????????????????????????????????????if (strcmp(c, color[i2]) == 0) {
????????????????????????????????????????????????d[i0][i1] = i2;
????????????????????????????????????????????????break;
????????????????????????????????????????}
????????????????????????????????}
????????????????????????}
????????????????}
????????????????m = 0;
????????????????for (i0 = 0; i0 < n; i0++)
????????????????????????s[i0] = 1;
????????????????for (i0 = 0; i0 < n; i0++) {
????????????????????????if (s[i0] > 0) {
????????????????????????????????m++;
????????????????????????????????s[i0] = 0;
????????????????????????????????for (i1 = i0+1; i1 < n; i1++) {
????????????????????????????????????????sw = 0;
????????????????????????????????????????for (i2 = 0; i2 < 6 && sw == 0; i2++) {
????????????????????????????????????????????????for (i3 = 0; i3 < 6 && sw == 0; i3++) {
????????????????????????????????????????????????????????if (d[i0][i2] == d[i1][i3]) {
????????????????????????????????????????????????????????????????if (d[i0][5-i2] != d[i1][5-i3])
????????????????????????????????????????????????????????????????????????sw = 1;
????????????????????????????????????????????????????????}
????????????????????????????????????????????????}
????????????????????????????????????????}
????????????????????????????????????????if (sw == 0)
????????????????????????????????????????????????s[i1] = 0;
????????????????????????????????}
????????????????????????}
????????????????}
????????????????printf("%d\n", n-m);
????????????????scanf("%d", &n);
????????}
??
????????return 0;
}

Compiler output:
main.c:3:1: error: expected identifier or '(' before '?' token
    3 | ??
      | ^
Language: C

#include<stdio.h>
int main(void){
	int i,j,n;
	char color[8];
	while(scanf("%d",&n),n!=0){
		int uesita[6]={"0"},yokomen[6]={"0"},del=0,k=-1;
		for(i=0;i<=n;i++){
			if(i<n){
				for(j=0;j<6;j++){
					scanf("%s",&color);
					if(j==0 || j==5)uesita[i]+=color[0];
					else yokomen[i]+=color[0];
				}
			}
			if(k>=0){
				if(k==0 || k==5 && uesita[k]==uesita[k+1])del++;
				else if(yokomen[k]==yokomen[k+1])del++;
			}
			k++;
		}
		printf("%d\n",del);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:31: error: cannot initialize array of 'int' from a string literal with type array of 'char'
    6 |                 int uesita[6]={"0"},yokomen[6]={"0"},del=0,k=-1;
      |                               ^
main.c:6:48: error: cannot initialize array of 'int' from a string literal with type array of 'char'
    6 |                 int uesita[6]={"0"},yokomen[6]={"0"},del=0,k=-1;
      |                                                ^
Language: C

#include<stdio.h>
int main(void)
{
	int n,i,j,z;
	char c1[1001],c2[1001],c3[1001],c4[1001],c5[1001],c6[1001];
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%s %s %s %s %s %s",&c1[i],&c2[i],&c3[i],&c4[i],&c5[i],&c6[i]);
	}
	for(i=0;i<n;i++){
		z=0;
		for(j=0;j<n;j++){
		if(c1[i]==c1[j] && c2[i]==c2[j] && c3[i]==c3[j] && c4[i]==c4[j] && c5[i]==c5[j] && c6[i]==c6[j]){
			z=z+1;
		}
		else if(c4[i]==c4[j] && c1[i]==c1[j] && c3[i]==c3[j] && c6[i]==c6[j]){
			if(c5[i]==c5[j] && c2[i]==c2[j]){
				z=z+1;
			}
		}
		else if(c4[i]==c6[j] && c1[i]==c3[j] && c3[i]==c1[j] && c6[i]==c4[j]){
			if(c5[i]==c2[j] && c2[i]==c5[j]){
				z=z+1;
			}
		}
		else if(c6[i]==c6[j] && c3[i]==c3[j] && c1[i]==c1[j] && c4[i]==c4[j]){
			if(c5[i]==c5[j] && c2[i]==c2[j]){
				z=z+1;
			}
		}
		else if(c6[i]==c4[j] && c3[i]==c1[j] && c1[i]==c3[j] && c4[i]==c6[j]){
			if(c2[i]==c5[j] && c5[i]==c2[j]){
				z=z+1;
			}
		}
		else if(c2[i]==c2[j] && c1[i]==c1[j] && c5[i]==c5[j] && c6[i]==c6[j]){
			if(c4[i]==c4[j] && c3[i]==c3[j]){
				z=z+1;
			}
		}
		else if(c2[i]==c6[j] && c1[i]==c5[j] && c5[i]==c1[j] && c6[i]==c2[j]){
			if(c4[i]==c3[j] && c3[i]==c4[j]){
				z=z+1;
			}
		}
		else if(c6[i]==c6[j] && c5[i]==c5[j] && c1[i]==c1[j] && c2[i]==c2[j]){
			if(c3[i]==c3[j] && c4[i]==c4[j]){
				z=z+1;
			}
		}
		else if(c6[i]==c2[j] && c5[i]==c1[j] && c1[i]==c5[j] && c2[i]==c6[j]){
			if(c3[i]==c4[j] && c4[i]==c3[j]){
				z=z+1;
			}
		}
		}
	}
	printf("%d\n",n);
	}
	return 0;
}

Compiler output:
main.c:60:9: error: expected identifier or '(' before 'return'
   60 |         return 0;
      |         ^~~~~~
main.c:61:1: error: expected identifier or '(' before '}' token
   61 | }
      | ^
Language: C++

#define sc second
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef pair<int,pii> pip; 
const int INF = (1<<25);
const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

int main(){
  int n;
  int ans=0;
  int box[30][6];
  bool b[30][30];
  int samenum;
  while(cin>> n,n){
    ans=0;
    for(int i=0;i<n;i++){
      for(int j=0;j<n;j++){
    	b[i][j]=false;
      }
    }
    for(int i=0;i<n;i++){
      for(int j=0;j<6;j++){
	string s;
	cin>> s;
	if(s=="Red") box[i][j]=0;
	else if(s=="Yellow") box[i][j]=1;
	else if(s=="Blue") box[i][j]=2;
	else if(s=="Magenta") box[i][j]=3;
	else if(s=="Green") box[i][j]=4;
	else if(s=="Cyan") box[i][j]=5;
      }
    }
    for(int i=0;i<n;i++){
      for(int j=0;j<n;j++){
	if(i==j) continue;
	if(b[i][j]==true) continue;
	b[i][j]=b[j][i]=true;
	for(int k=0;k<6;k++){
	  if(box[i][0]==box[j][k]){
	    samenum=k; break;
	  }
	}
	if(box[j][samenum]-box[i][0]==0){
	  if(box[i][5]==box[j][5]){
	    ans++;
	  }
	}
	else if(box[j][samenum]-box[i][0]==1){
	  if(box[i][5]==box[j][4]){
	    ans++;
	  }
	}
	else if(box[j][samenum]-box[i][0]==2){
	  if(box[i][5]==box[j][3]){
	    ans++;
	  }
	}
	else if(box[j][samenum]-box[i][0]==3){
	  if(box[i][5]==box[j][2]){
	    ans++;
	  }
	}
	else if(box[j][samenum]-box[i][0]==4){
	  if(box[i][5]==box[j][1]){
	    ans++;
	  }
	}
	else if(box[j][samenum]-box[i][0]==5){
	  if(box[i][5]==box[j][0]){
	    ans++;
	  }
	}
      }
    }
    cout<< ans<< endl;
  }
}

Compiler output:
a.cc:2:9: error: 'vector' does not name a type
    2 | typedef vector<int> vi;
      |         ^~~~~~
a.cc:3:9: error: 'pair' does not name a type
    3 | typedef pair<int,int> pii;
      |         ^~~~
a.cc:4:9: error: 'pair' does not name a type
    4 | typedef pair<int,pii> pip;
      |         ^~~~
a.cc: In function 'int main()':
a.cc:14:9: error: 'cin' was not declared in this scope
   14 |   while(cin>> n,n){
      |         ^~~
a.cc:23:9: error: 'string' was not declared in this scope
   23 |         string s;
      |         ^~~~~~
a.cc:24:15: error: 's' was not declared in this scope
   24 |         cin>> s;
      |               ^
a.cc:75:5: error: 'cout' was not declared in this scope
   75 |     cout<< ans<< endl;
      |     ^~~~
a.cc:75:18: error: 'endl' was not declared in this scope
   75 |     cout<< ans<< endl;
      |                  ^~~~
Language: C++

#include <stdio.h>
#include <string.h>
??
int main()
{
????????int i0, i1, i2, i3, n, m, d[30][6], s[30], sw;
????????char c[8];
????????char color[6][8] = {"Cyan", "Yellow", "Red", "Magenta", "Green", "Blue"};
??
????????scanf("%d", &n);
????????while (n > 0) {
????????????????for (i0 = 0; i0 < n; i0++) {
????????????????????????for (i1 = 0; i1 < 6; i1++) {
????????????????????????????????scanf("%s", c);
????????????????????????????????for (i2 = 0; i2 < 6; i2++) {
????????????????????????????????????????if (strcmp(c, color[i2]) == 0) {
????????????????????????????????????????????????d[i0][i1] = i2;
????????????????????????????????????????????????break;
????????????????????????????????????????}
????????????????????????????????}
????????????????????????}
????????????????}
????????????????m = 0;
????????????????for (i0 = 0; i0 < n; i0++)
????????????????????????s[i0] = 1;
????????????????for (i0 = 0; i0 < n; i0++) {
????????????????????????if (s[i0] > 0) {
????????????????????????????????m++;
????????????????????????????????s[i0] = 0;
????????????????????????????????for (i1 = i0+1; i1 < n; i1++) {
????????????????????????????????????????sw = 0;
????????????????????????????????????????for (i2 = 0; i2 < 6 && sw == 0; i2++) {
????????????????????????????????????????????????for (i3 = 0; i3 < 6 && sw == 0; i3++) {
????????????????????????????????????????????????????????if (d[i0][i2] == d[i1][i3]) {
????????????????????????????????????????????????????????????????if (d[i0][5-i2] != d[i1][5-i3])
????????????????????????????????????????????????????????????????????????sw = 1;
????????????????????????????????????????????????????????}
????????????????????????????????????????????????}
????????????????????????????????????????}
????????????????????????????????????????if (sw == 0)
????????????????????????????????????????????????s[i1] = 0;
????????????????????????????????}
????????????????????????}
????????????????}
????????????????printf("%d\n", n-m);
????????????????scanf("%d", &n);
????????}
??
????????return 0;
}

Compiler output:
a.cc:3:1: error: expected unqualified-id before '?' token
    3 | ??
      | ^