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

#include <stdio.h>
main(){
  int a,b,c,d;
  
  scanf("%d %d",&a,&b);
     if( a<=1 || 1000000000<=a || b<=1 || 100000000<=b )
        printf("Error\n");
        return;
    }
    while(1){
        c = a/b;
        d = a - c*b;
        if(d == 0) break;
        a = b;
        b = d;
    }
    printf("%d\n",b);
}

Compiler output:
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main(){
      | ^~~~
main.c: In function 'main':
main.c:8:9: error: 'return' with no value, in function returning non-void [-Wreturn-mismatch]
    8 |         return;
      |         ^~~~~~
main.c:2:1: note: declared here
    2 | main(){
      | ^~~~
main.c: At top level:
main.c:10:5: error: expected identifier or '(' before 'while'
   10 |     while(1){
      |     ^~~~~
main.c:17:12: error: expected declaration specifiers or '...' before string constant
   17 |     printf("%d\n",b);
      |            ^~~~~~
main.c:17:19: error: unknown type name 'b'
   17 |     printf("%d\n",b);
      |                   ^
main.c:18:1: error: expected identifier or '(' before '}' token
   18 | }
      | ^
Language: C

#include <stdio.h>
int main(void);
int main(){
  int a,b,c,d;
  
  scanf("%d %d",&a,&b);
     if( a<=1 || 1000000000<=a || b<=1 || 100000000<=b )
        printf("Error\n");
        return;
    }
    while(1){
        c = a/b;
        d = a - c*b;
        if(d == 0) break;
        a = b;
        b = d;
    }
    printf("%d\n",b);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:9: error: 'return' with no value, in function returning non-void [-Wreturn-mismatch]
    9 |         return;
      |         ^~~~~~
main.c:3:5: note: declared here
    3 | int main(){
      |     ^~~~
main.c: At top level:
main.c:11:5: error: expected identifier or '(' before 'while'
   11 |     while(1){
      |     ^~~~~
main.c:18:12: error: expected declaration specifiers or '...' before string constant
   18 |     printf("%d\n",b);
      |            ^~~~~~
main.c:18:19: error: unknown type name 'b'
   18 |     printf("%d\n",b);
      |                   ^
main.c:19:1: error: expected identifier or '(' before 'return'
   19 | return 0;
      | ^~~~~~
main.c:20:1: error: expected identifier or '(' before '}' token
   20 | }
      | ^
Language: C

#include <stdio.h>
int main(void);

main(){
  int a,b,c,d;
  
  scanf("%d %d",&a,&b);
     if( a<=1 || 1000000000<=a || b<=1 || 100000000<=b )
        printf("Error\n");
        return;
    }
    while(1){
        c = a/b;
        d = a - c*b;
        if(d == 0) break;
        a = b;
        b = d;
    }
    printf("%d\n",b);
return 0;
}

Compiler output:
main.c:4:1: error: return type defaults to 'int' [-Wimplicit-int]
    4 | main(){
      | ^~~~
main.c: In function 'main':
main.c:10:9: error: 'return' with no value, in function returning non-void [-Wreturn-mismatch]
   10 |         return;
      |         ^~~~~~
main.c:4:1: note: declared here
    4 | main(){
      | ^~~~
main.c: At top level:
main.c:12:5: error: expected identifier or '(' before 'while'
   12 |     while(1){
      |     ^~~~~
main.c:19:12: error: expected declaration specifiers or '...' before string constant
   19 |     printf("%d\n",b);
      |            ^~~~~~
main.c:19:19: error: unknown type name 'b'
   19 |     printf("%d\n",b);
      |                   ^
main.c:20:1: error: expected identifier or '(' before 'return'
   20 | return 0;
      | ^~~~~~
main.c:21:1: error: expected identifier or '(' before '}' token
   21 | }
      | ^
Language: C

#include <stdio.h>
int main(void);

main(){
  int N,i,j,A[100],key;
  
  scanf("%d",&N);
  if( N<1 || 100<N ){
    print("Error! \n Please retype");
    scanf("%d",&N);
  }
  i=0;
  while (scanf("%lf", &A[i]) != EOF) {
    i++;
  }
  for (j=2;j<=N;j++){
    key = A[j];
    /* insert A[j] into the sorted sequence A[1,...,j-1] */
    i = j-1; 
    while( i>1 && A[i]>key){
      A[i+1] = A[i];
      i = i - 1;
      A[i+1] = key;
    }
    for(i=1;i<=j;i++){
      printf("%d ",A[i]);
    }
    printf("\n");  
  }
  
  return 0;
}

Compiler output:
main.c:4:1: error: return type defaults to 'int' [-Wimplicit-int]
    4 | main(){
      | ^~~~
main.c: In function 'main':
main.c:9:5: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
    9 |     print("Error! \n Please retype");
      |     ^~~~~
      |     printf
Language: C

#include<stdio.h>
int main(void){
  int a,b;
  int x,i,N;

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

  if(a<=b){
    x=b%a;
    for(i=1;i<=x;i++){
      if(a%i==0)N=i;
    }
  }

  else {
    x=a%b;
    for(i=1;i<=x;i++){
      if(b%i==0)N=i;
    }
  }

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

#include<stdio.h>
int main(void){
  int a,b;
  int x,i,N;

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

  if(a<=b){
    x=b%a;
    for(i=1;i<=x;i++){
      if(a%i==0 && x%i==0)N=i;
    }
  }

  else {
    x=a%b;
    for(i=1;i<=x;i++){
      if(b%i==0 && x%i==0)N=i;
    }
  }

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

#include<iostream>

using namespace std;

int gcd(int x, int y)
{
    int t;
    if(x < y) swap(x, y);
    while(y)
        t = x % y, x = y, y = t;
    return x;
}


int main(){
	int m,n;
	while(cin>>m>>n){
        cout<<gcd(m, n)<<endl;
	}
}

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

using System;

class Program
{
    static void Main()
    {
        string[] input = Console.ReadLine().Split(' ');
        Console.WriteLine(Solve(int.Parse(input[0]),int.Parse(input[1])));
    }
    static int Solve(int a, int b)
    {
        int small,mod;
        if(a>b){
            small=b;
            mod=a%b;
        }else{
            small=a;
            mod=b%a;
        }
        if (mod == 0) return small;
        else return Solve(small, mod);
    }
}

Compiler output:
main.c:1:1: error: unknown type name 'using'
    1 | using System;
      | ^~~~~
main.c:3:1: error: unknown type name 'class'
    3 | class Program
      | ^~~~~
main.c:4:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    4 | {
      | ^
Language: C

#include<iostream>
using namespace std;

int gcd(int a, int b){
	if(a < b){
		int buf = a;
		a = b;
		b = buf;
	}

	if(a % b == 0)return b;
	else return gcd(b, a % b);

};

int main(){
	int a,b;

	cin >> a;
	cin >> b;

	cout << gcd(a,b);



	return 0;
}

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

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

int main() {
  int a, b;
  cin >> a >> b;
  cout << __gcd(a,b) << endl;
}

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

#include<stdio.h>

int gcd(int,int);
void swap(int, int);

int main(){
  int a,b;
  
  scanf("%d %d",&a,&b);
  printf("%d\n",gcd(a,b));
}

int gcd(a,b){
  int r,d;
  if(a<b){
     work=x;
  x=y;
  y=work;}
  while(b>0){
    r=a%b;
    a=b; 
    b=r;}
  return a;
}

Compiler output:
main.c: In function 'gcd':
main.c:13:5: error: type of 'a' defaults to 'int' [-Wimplicit-int]
   13 | int gcd(a,b){
      |     ^~~
main.c:13:5: error: type of 'b' defaults to 'int' [-Wimplicit-int]
main.c:16:6: error: 'work' undeclared (first use in this function)
   16 |      work=x;
      |      ^~~~
main.c:16:6: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:11: error: 'x' undeclared (first use in this function)
   16 |      work=x;
      |           ^
main.c:17:5: error: 'y' undeclared (first use in this function)
   17 |   x=y;
      |     ^
Language: C

#include<stdio.h>

int main(){
  int a,b,work;
  scanf("%d %d",&a,&b);
  while(r!=0){
    work=a%b;
    a=b; 
    b=work;}
  printf("%d\n",a);
}

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

#include<stdio.h>
main()
{
  int a,b,c,d,e;
  int j=1;
  scan("%d%d",&a,&b);
  while(j < a && j < b)
    {
      c=a%j;
      d=b%j;
      if(c==0 && d==0){
	e=j;
      }
      j++;
    }
  print("%d\n",e);
}

Compiler output:
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main()
      | ^~~~
main.c: In function 'main':
main.c:6:3: error: implicit declaration of function 'scan'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    6 |   scan("%d%d",&a,&b);
      |   ^~~~
      |   scanf
main.c:16:3: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
   16 |   print("%d\n",e);
      |   ^~~~~
      |   printf
Language: C

include<stdio.h>

int main(){
  int a,b,buf;
  
  scanf("%d%d", &a, &b);
  
  if(a >= b){
    while((buf = a % b) != 0){
      a = b;
      b = buf;
    }
    printf("%d\n", b);
  }
  else
    {
      while((buf = b % a) != 0){
	b = a;
	a = buf;
      }
      printf("%d\n", a);
    }
  
  return 0;
}

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

#include <stdio.h>

main(){
  int a,b,c;
  
  scanf("%d%d",&a,&b);
    while(a%b!=0){
      c=a%b;
      a=b;
      b=c;
    }
  printf("%d\n",b);
  }
}

Compiler output:
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main(){
      | ^~~~
main.c:14:1: error: expected identifier or '(' before '}' token
   14 | }
      | ^
Language: C

#include<stdio.h>

int gcd(int ,int);
int swap(int,int);

main(){
  int a,b;

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

  gcd(a,b);

  printf("%d\n",x);
}

int gcd(int x, int y){
  int n;

  if(x < y){
    n = x;
    x = y;
    y = n;
  }

  while(y>0){
    n = x%y;
    x = y;
    y = n;
  }
}

Compiler output:
main.c:6:1: error: return type defaults to 'int' [-Wimplicit-int]
    6 | main(){
      | ^~~~
main.c: In function 'main':
main.c:13:17: error: 'x' undeclared (first use in this function)
   13 |   printf("%d\n",x);
      |                 ^
main.c:13: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, xy, i, m;
    scanf("%d %d", &a, &b);
    /* 整数 x, y について、1 < y < x ならば
       x と y の最大公約数は y と x%y の
       最大公約数に等しい。
       ここで a%b は a を b で割った余りである。 */
        
    if(1 < a && 1 < b) {
        if(a == b) {
            printf("%d\n", a);
            return 0;
        }
        
        if(a < b) m = a; a = b;	b = m;
        }
        do{
        	m = b % a;
        	if(m == 0) {
        		printf("%d\n", a);
        		return 0;
        	}
        	b = a; a = m;
        }while(1);
    }
     
    return 0;
}

Compiler output:
main.c:29:5: error: expected identifier or '(' before 'return'
   29 |     return 0;
      |     ^~~~~~
main.c:30:1: error: expected identifier or '(' before '}' token
   30 | }
      | ^
Language: C

#include <iostream>
using namespace std;

int gcd(int a, int b){
    int t;
    if( a < b ){
        t = a;
        a = b;
        b = t;
    }
    while(1){
        t = a%b;
        if(t == 0) return b;
        a = b; b = t; 
    }
    return -1;
}

int main(){
    int a,b;
    cin >> a >> b;
    cout << gcd(a, b) << 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>
#include<conio.h>
int main(void){
	
	
	int a,b,i,gcd,m;
	
	
	scanf("%d %d",&a,&b);
	
	if(a>b)
		m = a;
	
	else
	m = b;
	
	for(i=m;i>=1;i--){
		if(a%i==0 &&  b%i==0){
			gcd=i;
			
		}
	}
	printf("%d",gcd);
	getch();
	return 0;

Compiler output:
main.c:2:9: fatal error: conio.h: No such file or directory
    2 | #include<conio.h>
      |         ^~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
#include<conio.h>
int main(void){
	
	
	int a,b,i,gcd,m;
	
	
	scanf("%d %d",&a,&b);
	
	if(a>b){
		m=a;
	}
	else
	m=b;
	for(i=m;i>=0;i--){
		if(a%i==0 &&  b%i==0){
			gcd=i;
			break;
			
		}
	}
	printf("%d",i);
	getch();
	return 0;
	
}

Compiler output:
main.c:2:9: fatal error: conio.h: No such file or directory
    2 | #include<conio.h>
      |         ^~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
#include<conio.h>
int main(void){
	
	
	int a,b,i,gcd,m;
	
	
	scanf("%d %d ",&a,&b);
	
	if(a>b){
		m=a;
	}
	else
	m=b;
	for(i=m;i>=0;i--){
		if(a%i==0 &&  b%i==0){
			gcd=i;
			break;
			
		}
	}
	printf("%d \n",i);
	getch();
	return 0;
	
}

Compiler output:
main.c:2:9: fatal error: conio.h: No such file or directory
    2 | #include<conio.h>
      |         ^~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>

int main(void){
	
	
	int a,b,i,gcd,m;
	
	
	scanf("%d %d ",&a,&b);
	
	if(a>b){
		m=a;
	}
	else
	m=b;
	for(i=m;i>=0;i--){
		if(a%i==0 &&  b%i==0){
			gcd=i;
			break;
			
		}
	}
	printf("%d \n",i);

	return 0;
	
}
}

Compiler output:
main.c:28:1: error: expected identifier or '(' before '}' token
   28 | }
      | ^
Language: C++

a, b = map(int, input().split())

def gcd(a, b):
    big = max(a, b)
    small = min(a, b)
    while not big % small == 0:
        big, small = small, big%small
    return small
    
print(gcd(a, b))



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

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

int calc_gcd(int x,int y){
    if(y == 0){
                return x;
    }
    else{
                return calc_gcd(y,x%y);
    }
}

int main(){
    int x,y;
    cin >> x >> y;
    if (x >= y){
        cout << calc(x,y) << endl;
    }
    else{
        cout << calc(y,x) << endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:17: error: 'calc' was not declared in this scope
   17 |         cout << calc(x,y) << endl;
      |                 ^~~~
a.cc:20:17: error: 'calc' was not declared in this scope
   20 |         cout << calc(y,x) << endl;
      |                 ^~~~
Language: C++

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

int calc_gcd(int x,int y){
    if(y == 0){
                return x;
    }
    else{
                return calc_gcd(y,x%y);
    }
}

int main(){
    int x,y;
    cin >> x >> y;
    if (x >= y){
        cout << calc(x,y) << endl;
    }
    else{
        cout << calc(y,x) << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:17: error: 'calc' was not declared in this scope
   17 |         cout << calc(x,y) << endl;
      |                 ^~~~
a.cc:20:17: error: 'calc' was not declared in this scope
   20 |         cout << calc(y,x) << endl;
      |                 ^~~~
Language: C++

x = input()
y = input()

if x < y:
	tmp = x
	x = y
	y = tmp

x_y_divisor = list()
y_divisor = list()
x_mod_y = x % y


for i in range(1,(x_mod_y)+1):
	if x_mod_y % i == 0:
		x_y_divisor.append(i)


for i in range(1,y+1):
	if y % i == 0:
		y_divisor.append(i)


x_y_divisor_set = set(x_y_divisor)
y_divisor_set = set(y_divisor)

ans_divisor = y_divisor_set.intersection(x_y_divisor_set)
print(max(ans_divisor))



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

//gcd(x, y) = gcd(y, x%y)
#include <iostream> 

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

int main() {
  cin >> a >> b;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   13 |   cin >> a >> b;
      |   ^~~
      |   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:13:10: error: 'a' was not declared in this scope
   13 |   cin >> a >> b;
      |          ^
a.cc:13:15: error: 'b' was not declared in this scope
   13 |   cin >> a >> b;
      |               ^
Language: C++

import java.lang.Math.*;
import java.util.*;
import java.io.Console;
import java.nio.file.Paths;
import java.io.IOException;
import java.io.*;
import java.math.*;

class test {
	public static void main(String[] args){
		Scanner cin = new Scanner(System.in);
		int a=cin.nextInt(),b=cin.nextInt();
		for(int i=(a<=b)?a:b;i>=1;i--){
			if(a%i==0 && b%i==0) {
				System.out.println(i);
			}
		}
	}
}


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.lang.Math.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.util.*;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.io.Console;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
    4 | import java.nio.file.Paths;
      | ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: 'import' does not name a type
    5 | import java.io.IOException;
      | ^~~~~~
a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: 'import' does not name a type
    6 | import java.io.*;
      | ^~~~~~
a.cc:6:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:7:1: error: 'import' does not name a type
    7 | import java.math.*;
      | ^~~~~~
a.cc:7:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:10:15: error: expected ':' before 'static'
   10 |         public static void main(String[] args){
      |               ^~~~~~~
      |               :
a.cc:10:33: error: 'String' has not been declared
   10 |         public static void main(String[] args){
      |                                 ^~~~~~
a.cc:10:42: error: expected ',' or '...' before 'args'
   10 |         public static void main(String[] args){
      |                                          ^~~~
a.cc:19:2: error: expected ';' after class definition
   19 | }
      |  ^
      |  ;
a.cc: In static member function 'static void test::main(int*)':
a.cc:11:17: error: 'Scanner' was not declared in this scope
   11 |                 Scanner cin = new Scanner(System.in);
      |                 ^~~~~~~
a.cc:12:23: error: 'cin' was not declared in this scope
   12 |                 int a=cin.nextInt(),b=cin.nextInt();
      |                       ^~~
a.cc:13:31: error: 'b' was not declared in this scope
   13 |                 for(int i=(a<=b)?a:b;i>=1;i--){
      |                               ^
a.cc:15:33: error: 'System' was not declared in this scope
   15 |                                 System.out.println(i);
      |                                 ^~~~~~
Language: C++


import java.util.Scanner;

class test {
	public static int solve(int a,int b) {
			 for(int i=(a<=b)?a:b;i>=1;i--){
						if(a%i==0 && b%i==0) return i;
					}
					return 1;
		}
		
	public static void main(String[] args){
		Scanner cin = new Scanner(System.in);
		int a=cin.nextInt(),b=cin.nextInt();
		System.out.println(solve(a,b));
	}
}


Compiler output:
a.cc:2:1: error: 'import' does not name a type
    2 | import java.util.Scanner;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:15: error: expected ':' before 'static'
    5 |         public static int solve(int a,int b) {
      |               ^~~~~~~
      |               :
a.cc:12:15: error: expected ':' before 'static'
   12 |         public static void main(String[] args){
      |               ^~~~~~~
      |               :
a.cc:12:33: error: 'String' has not been declared
   12 |         public static void main(String[] args){
      |                                 ^~~~~~
a.cc:12:42: error: expected ',' or '...' before 'args'
   12 |         public static void main(String[] args){
      |                                          ^~~~
a.cc:17:2: error: expected ';' after class definition
   17 | }
      |  ^
      |  ;
a.cc: In static member function 'static void test::main(int*)':
a.cc:13:17: error: 'Scanner' was not declared in this scope
   13 |                 Scanner cin = new Scanner(System.in);
      |                 ^~~~~~~
a.cc:14:23: error: 'cin' was not declared in this scope
   14 |                 int a=cin.nextInt(),b=cin.nextInt();
      |                       ^~~
a.cc:15:17: error: 'System' was not declared in this scope
   15 |                 System.out.println(solve(a,b));
      |                 ^~~~~~
a.cc:15:44: error: 'b' was not declared in this scope
   15 |                 System.out.println(solve(a,b));
      |                                            ^
Language: C++


import java.util.Scanner;

class test {

	public static void main(String[] args){
		Scanner cin = new Scanner(System.in);
		int a=cin.nextInt(),b=cin.nextInt();
		System.out.println(solve(a,b));
	}
	public static int solve(int a,int b) {
			 for(int i=(a<=b)?a:b;i>=1;i--){
						if(a%i==0 && b%i==0) return i;
					}
					return 1;
		}
		
}


Compiler output:
a.cc:2:1: error: 'import' does not name a type
    2 | import java.util.Scanner;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:15: error: expected ':' before 'static'
    6 |         public static void main(String[] args){
      |               ^~~~~~~
      |               :
a.cc:6:33: error: 'String' has not been declared
    6 |         public static void main(String[] args){
      |                                 ^~~~~~
a.cc:6:42: error: expected ',' or '...' before 'args'
    6 |         public static void main(String[] args){
      |                                          ^~~~
a.cc:11:15: error: expected ':' before 'static'
   11 |         public static int solve(int a,int b) {
      |               ^~~~~~~
      |               :
a.cc:18:2: error: expected ';' after class definition
   18 | }
      |  ^
      |  ;
a.cc: In static member function 'static void test::main(int*)':
a.cc:7:17: error: 'Scanner' was not declared in this scope
    7 |                 Scanner cin = new Scanner(System.in);
      |                 ^~~~~~~
a.cc:8:23: error: 'cin' was not declared in this scope
    8 |                 int a=cin.nextInt(),b=cin.nextInt();
      |                       ^~~
a.cc:9:17: error: 'System' was not declared in this scope
    9 |                 System.out.println(solve(a,b));
      |                 ^~~~~~
a.cc:9:44: error: 'b' was not declared in this scope
    9 |                 System.out.println(solve(a,b));
      |                                            ^
Language: C++

public static void main(String args[]) throws Exception
					{
							Scanner cin=new Scanner(System.in);
							int a=cin.nextInt(),b=cin.nextInt();
							 for(int i=(a<=b)?a:b;i>=1;i--){
										if(a%i==0 && b%i==0) System.out.println(i);
									}
							
					}	


Compiler output:
a.cc:1:1: error: expected unqualified-id before 'public'
    1 | public static void main(String args[]) throws Exception
      | ^~~~~~
Language: C++


import java.io.*;
import java.util.*;
class test {
					public static void main(String args[])
					{
							Scanner cin=new Scanner(System.in);
							int a=cin.nextInt(),b=cin.nextInt();
							 for(int i=(a<=b)?a:b;i>=1;i--){
										if(a%i==0 && b%i==0) System.out.println(i);
									}
							
					}	
}




Compiler output:
a.cc:2:1: error: 'import' does not name a type
    2 | import java.io.*;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.util.*;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:47: error: expected ':' before 'static'
    5 |                                         public static void main(String args[])
      |                                               ^~~~~~~
      |                                               :
a.cc:5:65: error: 'String' has not been declared
    5 |                                         public static void main(String args[])
      |                                                                 ^~~~~~
a.cc:14:2: error: expected ';' after class definition
   14 | }
      |  ^
      |  ;
a.cc: In static member function 'static void test::main(int*)':
a.cc:7:57: error: 'Scanner' was not declared in this scope
    7 |                                                         Scanner cin=new Scanner(System.in);
      |                                                         ^~~~~~~
a.cc:8:63: error: 'cin' was not declared in this scope
    8 |                                                         int a=cin.nextInt(),b=cin.nextInt();
      |                                                               ^~~
a.cc:9:72: error: 'b' was not declared in this scope
    9 |                                                          for(int i=(a<=b)?a:b;i>=1;i--){
      |                                                                        ^
a.cc:10:102: error: 'System' was not declared in this scope
   10 |                                                                                 if(a%i==0 && b%i==0) System.out.println(i);
      |                                                                                                      ^~~~~~
Language: C++


import java.io.*;
import java.util.*;
					public class main(String args[])
					{
							Scanner cin=new Scanner(System.in);
							int a=cin.nextInt(),b=cin.nextInt();
							 for(int i=(a<=b)?a:b;i>=1;i--){
										if(a%i==0 && b%i==0) System.out.println(i);
									}
							
					}




Compiler output:
a.cc:2:1: error: 'import' does not name a type
    2 | import java.io.*;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.util.*;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:41: error: expected unqualified-id before 'public'
    4 |                                         public class main(String args[])
      |                                         ^~~~~~
Language: C++


import java.io.*;
import java.util.*;
class test {
								public static void main(String args[])
								{
										Scanner cin=new Scanner(System.in);
										int a=cin.nextInt(),b=cin.nextInt();
										System.out.println(GCD(a,b));
								}
					public static  int GCD(int a, int b) {
						if (b==0) return a;
						return GCD(b,a%b);
					}
}




Compiler output:
a.cc:2:1: error: 'import' does not name a type
    2 | import java.io.*;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.util.*;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:71: error: expected ':' before 'static'
    5 |                                                                 public static void main(String args[])
      |                                                                       ^~~~~~~
      |                                                                       :
a.cc:5:89: error: 'String' has not been declared
    5 |                                                                 public static void main(String args[])
      |                                                                                         ^~~~~~
a.cc:11:47: error: expected ':' before 'static'
   11 |                                         public static  int GCD(int a, int b) {
      |                                               ^~~~~~~
      |                                               :
a.cc:15:2: error: expected ';' after class definition
   15 | }
      |  ^
      |  ;
a.cc: In static member function 'static void test::main(int*)':
a.cc:7:81: error: 'Scanner' was not declared in this scope
    7 |                                                                                 Scanner cin=new Scanner(System.in);
      |                                                                                 ^~~~~~~
a.cc:8:87: error: 'cin' was not declared in this scope
    8 |                                                                                 int a=cin.nextInt(),b=cin.nextInt();
      |                                                                                       ^~~
a.cc:9:81: error: 'System' was not declared in this scope
    9 |                                                                                 System.out.println(GCD(a,b));
      |                                                                                 ^~~~~~
a.cc:9:106: error: 'b' was not declared in this scope
    9 |                                                                                 System.out.println(GCD(a,b));
      |                                                                                                          ^
Language: C++

int main()
{
	int a, b;
	cin >> a >> b;

	int small,gcd;
	gcd = 1;
	small = (a > b) ? b : a;
	//cout << "small : " << small << endl;

	for (int i = 2; i <= small; i++) {
		while (a%i == 0 && b%i == 0) {
			a = a / i;
			b = b / i;
			gcd = gcd * i;
		}
	}

	cout << gcd << endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'cin' was not declared in this scope
    4 |         cin >> a >> b;
      |         ^~~
a.cc:19:9: error: 'cout' was not declared in this scope
   19 |         cout << gcd << endl;
      |         ^~~~
a.cc:19:24: error: 'endl' was not declared in this scope
   19 |         cout << gcd << endl;
      |                        ^~~~
Language: C++

#include<jiostream>
using namwspace std;
 
int gcd(int a, int b) {
    c = a % b;
    a = b; b = c;
    if c!= 0 return gcd(a, b);
    else return 1;
}

int main() {
    int a, int b;
    
    cin >> a >> b;
    cout << gcd(a, b);
    
    return 0;
}


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

int main() {
    int a, b, c;
    
    cin >> a >> b;
    while ( b != 0 ) {
    	c = a % b; 
    	a = b;
    	b = c;
	}
	cout << a;
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: 'cin' was not declared in this scope
    4 |     cin >> a >> b;
      |     ^~~
a.cc:10:9: error: 'cout' was not declared in this scope
   10 |         cout << a;
      |         ^~~~
Language: C++

#include<iostream>
using namespace std;

int gcd(int a, int b) {
    b == 0? return b : return gcd(b, a % b);
}

int main() {
    int a, b;
    
    cin >> a >> b;
    a = gcd(a, b);
    cout << a << endl;
    
    return 0;
}


Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:5:13: error: expected primary-expression before 'return'
    5 |     b == 0? return b : return gcd(b, a % b);
      |             ^~~~~~
a.cc:5:12: error: expected ':' before 'return'
    5 |     b == 0? return b : return gcd(b, a % b);
      |            ^~~~~~~
      |            :
a.cc:5:13: error: expected primary-expression before 'return'
    5 |     b == 0? return b : return gcd(b, a % b);
      |             ^~~~~~
a.cc:6:1: warning: no return statement in function returning non-void [-Wreturn-type]
    6 | }
      | ^
Language: C++


#include <iostream>
#include <math.h>
#include <string>
#include <algorithm>
#include <set>
#include <queue>
#include <stack>
#include <utility>
#include <tuple>
using namespace std;

const double pi = acos(-1);
#define nyan cout<<"(=^•ω•^=)"<<endl;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)

int gcd(int i, int j){
    if(i>j)swap(i,j);
    if(i==j)return i;
    else return gcd(i,j%i)
}

signed main(){
    int x,y;
    cin>>x>>y;
    cout<<gcd(x,y)<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'long long int gcd(long long int, long long int)':
a.cc:21:27: error: expected ';' before '}' token
   21 |     else return gcd(i,j%i)
      |                           ^
      |                           ;
   22 | }
      | ~
Language: C++

#include<stdio.h>
int gcd(x,y){
	return y?gcd(y,x%y):x;
} 
int main()
{
    int k,k1;
    scanf("%d%d",&k,&k1);
    printf("%d\n",gcd(k,k1));
    return 0;
}



Compiler output:
a.cc:2:9: error: 'x' was not declared in this scope
    2 | int gcd(x,y){
      |         ^
a.cc:2:11: error: 'y' was not declared in this scope
    2 | int gcd(x,y){
      |           ^
a.cc:2:12: error: expression list treated as compound expression in initializer [-fpermissive]
    2 | int gcd(x,y){
      |            ^
a.cc: In function 'int main()':
a.cc:9:22: error: 'gcd' cannot be used as a function
    9 |     printf("%d\n",gcd(k,k1));
      |                   ~~~^~~~~~
Language: C++

#include<stdio.h>
int gcd(x,y){
	return y?gcd(y,x%y):x;
} 
int main()
{
    int k,k1;
    scanf("%d%d",&k,&k1);
    printf("%d\n",gcd(k,k1));
}



Compiler output:
a.cc:2:9: error: 'x' was not declared in this scope
    2 | int gcd(x,y){
      |         ^
a.cc:2:11: error: 'y' was not declared in this scope
    2 | int gcd(x,y){
      |           ^
a.cc:2:12: error: expression list treated as compound expression in initializer [-fpermissive]
    2 | int gcd(x,y){
      |            ^
a.cc: In function 'int main()':
a.cc:9:22: error: 'gcd' cannot be used as a function
    9 |     printf("%d\n",gcd(k,k1));
      |                   ~~~^~~~~~
Language: C++

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

int main(){
    int x,y;
    while(1){
        if(x%y==0)break;
        x%y=x;
        x=max(x,y);
        y=min(x,y);
    }
    cout<<x<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:10: error: lvalue required as left operand of assignment
    9 |         x%y=x;
      |         ~^~
Language: C++

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

int main(){
    int x,y;
    cin>>x>>y;
    cout<<gcd(x,y)<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: 'gcd' was not declared in this scope
    8 |     cout<<gcd(x,y)<<endl;
      |           ^~~
Language: C++

#include<iostream>
using namespace std;
long long gcd(long long x, long long y){
    if x < y
        swap(x, y)
    while y > 0
        r = x % y
        x = y
        y = r

    return x
}

int main(){
    long long x, y;
    cin >> x >> y;
    cout << gcd(x, y) << endl;
    
    return 0;
}


Compiler output:
a.cc: In function 'long long int gcd(long long int, long long int)':
a.cc:4:8: error: expected '(' before 'x'
    4 |     if x < y
      |        ^
      |        (
a.cc:12:1: warning: no return statement in function returning non-void [-Wreturn-type]
   12 | }
      | ^
Language: C++

#include<iostream>
using namespace std;
long long gcd(long long x, long long y){
    int r = 0;
    if(x < y){
        swap(x, y);
    }
    while(y > 0){
        r = x % y
        x = y
        y = r
    }
    return x
}

int main(){
    long long x, y;
    cin >> x >> y;
    cout << gcd(x, y) << endl;
    
    return 0;
}


Compiler output:
a.cc: In function 'long long int gcd(long long int, long long int)':
a.cc:9:18: error: expected ';' before 'x'
    9 |         r = x % y
      |                  ^
      |                  ;
   10 |         x = y
      |         ~         
a.cc:13:13: error: expected ';' before '}' token
   13 |     return x
      |             ^
      |             ;
   14 | }
      | ~
Language: C++

#include<iostream>
using namespace std;
int gcd(int x, int y){
    int r = 0;
    if(x < y){
        swap(x, y);
    }
    while(y > 0){
        r = x % y
        x = y
        y = r
    }
    return x
}

int main(){
    int x, y;
    cin >> x >> y;
    cout << gcd(x, y) << endl;
    
    return 0;
}


Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:9:18: error: expected ';' before 'x'
    9 |         r = x % y
      |                  ^
      |                  ;
   10 |         x = y
      |         ~         
a.cc:13:13: error: expected ';' before '}' token
   13 |     return x
      |             ^
      |             ;
   14 | }
      | ~
Language: C++

#include<iostream>
using namespace std;
long long gcd(long long x, long long y){
    int r = 0;
    if(x < y){
        swap(x, y);
    }
    while(y > 0){
        r = x % y;
        x = y;
        y = r;
    }
    return x
}

int main(){
    long long x, y;
    cin >> x >> y;
    cout << gcd(x, y) << endl;
    
    return 0;
}


Compiler output:
a.cc: In function 'long long int gcd(long long int, long long int)':
a.cc:13:13: error: expected ';' before '}' token
   13 |     return x
      |             ^
      |             ;
   14 | }
      | ~
Language: C++

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

using namespace std;

int main() {
	int a, b, r;
	cin >> a >> b;
	if ((0 == a) || (0 == b)){
	r = 0;
}
r = a % b;
while (r != 0)
{
	a = b;
	b = r;
	r = a % b;

}
	cout << b << endl;
	return 0;
}


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


#include <iostream>

using namespace std;

int main(){
    int x,y;
    cin >> x >> y;
    if(x >= y){
        gcd(x, y);
    }else{
        gcd(y, x);
    }
}

void gcd(int x,int y){
    if(x % y != 0){
        gcd(y, x % y);
    }else{
        cout << y;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'gcd' was not declared in this scope
   10 |         gcd(x, y);
      |         ^~~
a.cc:12:9: error: 'gcd' was not declared in this scope
   12 |         gcd(y, x);
      |         ^~~
Language: C++

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

int gcd(int a, int b) {
    int n = (a < b) ? a : b;
    
    if(a % n == 0 && b & n == 0) {
        return n;
    }
    for(int i = sqrt(n); i > 0; --i) {
        if{a % i == 0 && b % i == 0) {
            return i;
        }
    }
}
int main(void) {
    int a, b;
    
    cin >> a >> b;
    
    cout << gcd(a, b) << endl;
    
    return 0;
    
}


Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:12:11: error: expected '(' before '{' token
   12 |         if{a % i == 0 && b % i == 0) {
      |           ^
      |           (
a.cc:17:16: error: a function-definition is not allowed here before '{' token
   17 | int main(void) {
      |                ^
a.cc:26:2: error: expected '}' at end of input
   26 | }
      |  ^
a.cc:5:23: note: to match this '{'
    5 | int gcd(int a, int b) {
      |                       ^
a.cc:26:2: warning: control reaches end of non-void function [-Wreturn-type]
   26 | }
      |  ^
Language: C++

#include <iostream>
using namespace std;

int main(){
	int a,b,tmp;
	cin >> a;
	cin >> b;
	while(1){
			if(b==0){
				cout << a;
				break;
			}
		}else{
			tmp = a;
			a = b;
			b = tmp % b;
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:18: error: 'else' without a previous 'if'
   13 |                 }else{
      |                  ^~~~
a.cc: At global scope:
a.cc:19:9: error: expected unqualified-id before 'return'
   19 |         return 0;
      |         ^~~~~~
a.cc:20:1: error: expected declaration before '}' token
   20 | }
      | ^
Language: C++

#include <iostream>

int gcd( int a, int b )
{
  if( a < b ) { return gcd( b, a ); }
  if( b > 0 ) { return gcd( b, a % b ); }
  return a;
}

int main()
{
  std::ios::sync_with_stdio( false );
  int a = 0, b = 0;
  std::cin >> a; std::cin.ignore();
  std::cin >> b;

  std::cout << gcd( a, b ) std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:27: error: expected ';' before 'std'
   17 |   std::cout << gcd( a, b ) std::endl;
      |                           ^~~~
      |                           ;
Language: C++

#include<stdio.h>
int gcd(int x,int y){
int n    
n=x;
if (y<x){n=y;y=x;}
    for(int i=n;i>1;i--)
        if(x%i==0&&y%i==0){d=i;break;}
          
            return d
}


int main()
{
int x,y,r;
r=0;
scanf("%d %d",&x,&y);
r=gcd(x,y);
printf("%d",r);
return 0;
}

Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:4:1: error: expected initializer before 'n'
    4 | n=x;
      | ^
a.cc:5:10: error: 'n' was not declared in this scope
    5 | if (y<x){n=y;y=x;}
      |          ^
a.cc:6:15: error: 'n' was not declared in this scope
    6 |     for(int i=n;i>1;i--)
      |               ^
a.cc:7:28: error: 'd' was not declared in this scope
    7 |         if(x%i==0&&y%i==0){d=i;break;}
      |                            ^
a.cc:9:20: error: 'd' was not declared in this scope
    9 |             return d
      |                    ^
a.cc:9:21: error: expected ';' before '}' token
    9 |             return d
      |                     ^
      |                     ;
   10 | }
      | ~
Language: C++

#include <iostream>
using namespace std;

int main(){
	int x, y;
	int a, b, r;
	int gcd;
	
	cin >> x >> y;
	
	if(x > y){
		a = x;
		b = y;
	}else {
		a = y;
		b = x;
	}
	
	do{
		r = a % b;
		gcd = a = b;
		b = r;
	}while(b != 0);
	
	cout << tmp << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:17: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   25 |         cout << tmp << endl;
      |                 ^~~
      |                 tm
Language: C++

#include<stdio.h>

int main()
{
    int x,y;
    scanf("%d %d",&x,&y);
    int n;
    for(n=1;n<=x&&n<=y;n++)
        {
     ???     int k;
            if(x%n==0 && y%n==0) k=n;
        }
    printf("%d\n",k);
    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:6: error: expected primary-expression before '?' token
   10 |      ???     int k;
      |      ^
a.cc:10:7: error: expected primary-expression before '?' token
   10 |      ???     int k;
      |       ^
a.cc:10:8: error: expected primary-expression before '?' token
   10 |      ???     int k;
      |        ^
a.cc:10:14: error: expected primary-expression before 'int'
   10 |      ???     int k;
      |              ^~~
a.cc:10:9: error: expected ':' before 'int'
   10 |      ???     int k;
      |         ^    ~~~
      |         :
a.cc:10:14: error: expected primary-expression before 'int'
   10 |      ???     int k;
      |              ^~~
a.cc:10:9: error: expected ':' before 'int'
   10 |      ???     int k;
      |         ^    ~~~
      |         :
a.cc:10:14: error: expected primary-expression before 'int'
   10 |      ???     int k;
      |              ^~~
a.cc:10:9: error: expected ':' before 'int'
   10 |      ???     int k;
      |         ^    ~~~
      |         :
a.cc:10:14: error: expected primary-expression before 'int'
   10 |      ???     int k;
      |              ^~~
a.cc:11:34: error: 'k' was not declared in this scope
   11 |             if(x%n==0 && y%n==0) k=n;
      |                                  ^
a.cc:13:19: error: 'k' was not declared in this scope
   13 |     printf("%d\n",k);
      |                   ^
Language: C++

#include<stdio.h>

int main()
{
    int x,y;
    scanf("%d %d",&x,&y);
    int n;
    for(n=1;n<=x&&n<=y;n++)
        {
     ???     int k=1;
            if(x%n==0 && y%n==0) k=n;
        }
    printf("%d\n",k);
    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:6: error: expected primary-expression before '?' token
   10 |      ???     int k=1;
      |      ^
a.cc:10:7: error: expected primary-expression before '?' token
   10 |      ???     int k=1;
      |       ^
a.cc:10:8: error: expected primary-expression before '?' token
   10 |      ???     int k=1;
      |        ^
a.cc:10:14: error: expected primary-expression before 'int'
   10 |      ???     int k=1;
      |              ^~~
a.cc:10:9: error: expected ':' before 'int'
   10 |      ???     int k=1;
      |         ^    ~~~
      |         :
a.cc:10:14: error: expected primary-expression before 'int'
   10 |      ???     int k=1;
      |              ^~~
a.cc:10:9: error: expected ':' before 'int'
   10 |      ???     int k=1;
      |         ^    ~~~
      |         :
a.cc:10:14: error: expected primary-expression before 'int'
   10 |      ???     int k=1;
      |              ^~~
a.cc:10:9: error: expected ':' before 'int'
   10 |      ???     int k=1;
      |         ^    ~~~
      |         :
a.cc:10:14: error: expected primary-expression before 'int'
   10 |      ???     int k=1;
      |              ^~~
a.cc:11:34: error: 'k' was not declared in this scope
   11 |             if(x%n==0 && y%n==0) k=n;
      |                                  ^
a.cc:13:19: error: 'k' was not declared in this scope
   13 |     printf("%d\n",k);
      |                   ^
Language: C++

#include<stdio.h>

int main()
{
    int x,y;
    scanf("%d %d",&x,&y);
    int n;
    for(n=1; (n<=x) && (n<=y) ;n++)
        {
     ???     int k=1;
            if((x%n==0) && (y%n==0)) k=n;
        }
    printf("%d\n",k);
    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:6: error: expected primary-expression before '?' token
   10 |      ???     int k=1;
      |      ^
a.cc:10:7: error: expected primary-expression before '?' token
   10 |      ???     int k=1;
      |       ^
a.cc:10:8: error: expected primary-expression before '?' token
   10 |      ???     int k=1;
      |        ^
a.cc:10:14: error: expected primary-expression before 'int'
   10 |      ???     int k=1;
      |              ^~~
a.cc:10:9: error: expected ':' before 'int'
   10 |      ???     int k=1;
      |         ^    ~~~
      |         :
a.cc:10:14: error: expected primary-expression before 'int'
   10 |      ???     int k=1;
      |              ^~~
a.cc:10:9: error: expected ':' before 'int'
   10 |      ???     int k=1;
      |         ^    ~~~
      |         :
a.cc:10:14: error: expected primary-expression before 'int'
   10 |      ???     int k=1;
      |              ^~~
a.cc:10:9: error: expected ':' before 'int'
   10 |      ???     int k=1;
      |         ^    ~~~
      |         :
a.cc:10:14: error: expected primary-expression before 'int'
   10 |      ???     int k=1;
      |              ^~~
a.cc:11:38: error: 'k' was not declared in this scope
   11 |             if((x%n==0) && (y%n==0)) k=n;
      |                                      ^
a.cc:13:19: error: 'k' was not declared in this scope
   13 |     printf("%d\n",k);
      |                   ^
Language: C++

#include<stdio.h>

int main()
{
    int x,y;
    scanf("%d %d",&x,&y);
    int n;
    int k=1;
    int a=x/2;b=y/2
    for(n=1; (n<=a) && (n<=b) ;n++)
        {
            if((x%n==0) && (y%n==0)) k=n;
        }
    printf("%d\n",k);
    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:15: error: 'b' was not declared in this scope
    9 |     int a=x/2;b=y/2
      |               ^
a.cc:10:35: error: expected ';' before ')' token
   10 |     for(n=1; (n<=a) && (n<=b) ;n++)
      |                                   ^
      |                                   ;
Language: C++

#include<stdio.h>

int main()
{
    int x,y;
    scanf("%d %d",&x,&y);
    int n;
    int k;
    int z,Z;
    if(x<y) z=x,Z=y;
    else z=y,Z=x;
    if(Z%2==0)
    int sz=Z*0.5;
    else
    int sz=Z*0.5+0.5;
    if(z<=sz)
    {
        for(n=z; n>=1 ;n--)
        {
            if(z%n==0)
                {if(Z%n==0) {k=n;break;}}
        }
     }
     else
     {
      for(n=sz; n>=1 ;n--)
            {
                if(z%n==0)
                    {if(Z%n==0) {k=n;break;}}
            }
     }
    
    printf("%d\n",k);
    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:11: error: 'sz' was not declared in this scope; did you mean 'z'?
   16 |     if(z<=sz)
      |           ^~
      |           z