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

/**
 *   created: 01 June 2019  12:55:56
**/
#include<bits/stdc++.h>
using namespace std;

typedef vector<int> vi;
typedef pair<int , int> pii;
typedef vector< pair<int , int> > vii;
typedef long long ll;
typedef vector<long long> vl;
typedef pair<long long , long long> pll;
typedef vector< pair<long long , long long> > vll;

#define PB push_back
#define PPB pop_back
#define all(c) c.begin(),c.end()
#define rep(i,a,b) for(int i = (int)(a); i < (int)(b); i++)
#define rrep(i,a,b) for(int i = (int)(a-1); i>=(int)(b); i--)
#define INFLL 2000000000000000007
#define INF 2000000007
#define MOD 1000000007


#define TRACE

#ifdef TRACE
#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define trace6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;

#else

#define trace1(x)
#define trace2(x, y)
#define trace3(x, y, z)
#define trace4(a, b, c, d)
#define trace5(a, b, c, d, e)
#define trace6(a, b, c, d, e, f)

#endif


void optimizeIO()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
}

//                                        //AUTHOR: Kaushalesh Shukla

//=========================================================================================================

int main()
{
	optimizeIO();
	int tt=1;
	//cin>>tt;
	while(tt--){
		int n,m;
		cin>>n>>m;
		int cnt=0,res;
		rep(i,1,105){
			if(n%i==0 && m%i==0)
				cnt++;
			if(cnt==k){
				res=i;
				break;
			}
		}
		cout<<res;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:69:33: error: 'k' was not declared in this scope
   69 |                         if(cnt==k){
      |                                 ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main() {
  int a,b,k,c=0;
  cin>>a>>b>>k;
  for(int i=min(a,b);i>=1;--i) {
    if(a%i==0 && b%i==0)
      c++;
    if(c==k) {
      cout<<i;
      break;
    }
  }
  return 0;


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

#include <bits/stdc++.h>
using namespace std;
int main(){
  int A,B,K;
  cin >> A >> B >> K;
  int c=0;
  for (int i=min(A,B);i>0;i--){
    if (A%i==0,B%i==0){
      c+=1;
    }
    if (c==K){
      c=i;
      break
  }
  cout << c << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:12: error: expected ';' before '}' token
   13 |       break
      |            ^
      |            ;
   14 |   }
      |   ~         
a.cc:16:2: error: expected '}' at end of input
   16 | }
      |  ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C

#include<stdio.h>
int min(int x,int y){
  if(x>y)
    return y;
  else
    return x;
}
int main(void){
  int A,B,K,div,c,i;
  scanf("%d %d %d",&A,&B,&K);
  div=min(A,B);
  c=0;
  for(i=div;i>=1;i--){
  if(A%i==q&&B%i==0)
    c++;
    if(c==K)
      break;
  }
  printf("%d",i);
  return 0;
}
  

Compiler output:
main.c: In function 'main':
main.c:14:11: error: 'q' undeclared (first use in this function)
   14 |   if(A%i==q&&B%i==0)
      |           ^
main.c:14:11: note: each undeclared identifier is reported only once for each function it appears in
Language: Java

import java.util.*;
import java.util.stream.IntStream;

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

        Scanner s = new Scanner(System.in);

        int a = Integer.parseInt(s.next());
        int b = Integer.parseInt(s.next());
        int k = Integer.parseInt(s.next());

        int min = a < b ? a : b;

        Optional<Integer> an = IntStream.range(1, min)
                .filter(n -> a % n == 0 && b % n == 0)
                .boxed()
                .sorted(Comparator.reverseOrder())
                .skip(k - 1)
                .findFirst();

        System.out.println(an.orElse(0));
    }
}

Compiler output:
Main.java:4: error: class BKthCommonDivisor is public, should be declared in a file named BKthCommonDivisor.java
public class BKthCommonDivisor {
       ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b,k;
  cin>>a>>b>>k;
  int ans;
  int count=0;
  for(int i=min(a,b);i>0;i--){
    if(a%i==0&&b%i==0){count++; if(count==k){ans=i;} break;}
    else{continue;}
    cout<<ans;
}


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

#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b,k;
  cin>>a>>b>>k;
  int ans;
  int count=0;
  for(int i=min(a,b);i>0;i--){
    if(a%i==0&&b%i==0){count++; if(count==4){ans=i;} break;}
    else{continue;}
    cout<<ans;
}


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

    #include<iostream>
    #include<vector>
    #include<iterator>
    #include <algorithm>

    using namespace std;

    int main(){
        int a, b, k; cin >> a >> b >> k;
        int max = 0;
        for (int i = 1; i < 100; i++){
            if (a%i == 0 && b%i == 0){
                max = i;
                k--;
                if k==0{
                    break;
                }
            }
        }

        cout << max << endl;
        return 0;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:15:20: error: expected '(' before 'k'
   15 |                 if k==0{
      |                    ^
      |                    (
Language: C++

int main(){
	int a, b, k;
	cin >> a >> b >> k;
	int cnt = 0;
	int i;
	for (i = 1; i <= min(a,b); i++ ) {
		if (a % i == 0 && b % i == 0 ) {
			cnt++;
		}
		if (cnt == k) {
			break;
		}
	}
	cout << i << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:3:9: error: 'cin' was not declared in this scope
    3 |         cin >> a >> b >> k;
      |         ^~~
a.cc:6:26: error: 'min' was not declared in this scope; did you mean 'main'?
    6 |         for (i = 1; i <= min(a,b); i++ ) {
      |                          ^~~
      |                          main
a.cc:14:9: error: 'cout' was not declared in this scope
   14 |         cout << i << endl;
      |         ^~~~
a.cc:14:22: error: 'endl' was not declared in this scope
   14 |         cout << i << endl;
      |                      ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 int main(){
   int A,B,K;
   cin>>A>>B>>K;
   
   int sum=0;
   
   for(int i=0;i<max(A,B);i++){
     if(A%i==0&&B%i==0){
       sum++;
     }
     if(sum==K){
       cout<<i<<endl;
     }
   }
   
       
   

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

#include <iostream>
using namespace std;
int main(){
  int a,b,c,count=0;
  cin>>a>>b>>c;
  for(int i=0;i<100;i++){
    if(a%i == 0 && b%i == 0){
      count++;
      if(count == c){
        cout<<i<<endl;
        return 0;
      }
    }
  }

      
      

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

#include "stdafx.h"
#include <string>
#include <list>
#include <set>
#include <iostream>

int main()
{
	int a, b, k;
	std::cin >> a >> b >> k;
	int c = 0;

	int n = (a >= b) ? a : b;
	for (int i = 1; i<= a; i++) {
		if ((a%i == 0) && (b%i == 0))c++;
		if (c == k) {
			c = i;
			break;
		}
	}

	std::cout << c;
   return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
int gcd(int a,int b){
  if(a==0)return b;
  else if(b==0)return a;
  else if(a>b)return gcd(a%b,b);
  else return gcd(a,b%a);
}

int main(void){
  int a,b,k;
  cin>>a>>b>>k;
  int g = gcd(a,b);
  int c=1;
  while(c<k){
    for(int i=2;i<g;i++){
      if(g%i==0){
        g/=i;
      	c++;
      	break;
      }
    }
    if(i==g)break;
  }
  cout<<g<<endl;
  return 0;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:23:8: error: 'i' was not declared in this scope
   23 |     if(i==g)break;
      |        ^
Language: C++

//#include <bits/stdc++.h>
#include<iostream>
#include<algorithm>
using namespace std;
 
int main()
{
	int a, b, k, gcd[100] = {}, all = 0, cnt = 0, tmp = 0;
	cin >> a >> b >> k;
	
	for (int i = 1; i <= 100; i++) {
		if (a%i == 0 && b%i == 0)gcd[i] = i; all++;
	}
	
	for (int i = 1; i <= 100; i++) {	
		if (gcd[i] > 0)cnt++;	
		if (k == all - cnt) tmp = gcd[i];  break;
	}
	

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

#include<stdio.h>]

int main(void){
  int a=0,b=0,k=0,d=0;
  int c[100];
scanf("%d",&a);
scanf("%d",&b);
scanf("%d",&d);
 
  for(int i=1;i<a;i++){
  if(a%i=0&&b%i=0){ c[k]=i;
                   k++;
                  }
  }
  printf("%d",c[d-1]);
  
}

Compiler output:
main.c:1:18: warning: extra tokens at end of #include directive
    1 | #include<stdio.h>]
      |                  ^
main.c: In function 'main':
main.c:11:16: error: lvalue required as left operand of assignment
   11 |   if(a%i=0&&b%i=0){ c[k]=i;
      |                ^
Language: Java

import java.util.*;
import java.io.*;
class Program{

}
class Main{
    public static void main(String args[]) throws IOException{
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt(), B = sc.nextInt(), K = sc.nextInt();
    int small = Math.min(A,B), big = Math.max(A,B);
    if (big%small==0) fact.add(small);
    ArrayList <Integer> fact = new ArrayList<Integer>();
    for(int i = 1;i<=(int)Math.sqrt(small);i++){
        if (small%i==0){
            if(big%i==0){
                fact.add(i);
                if (big%(small/i)==0) fact.add(small/i);
            }
        }
    }
    Collections.sort(fact);
    System.out.println(fact.get(K+1));
    }
}



Compiler output:
Main.java:12: error: cannot find symbol
    if (big%small==0) fact.add(small);
                      ^
  symbol:   variable fact
  location: class Main
1 error
Language: C++

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

int main() {
	int A, B, K,cnt=0,ans=0;
	cin >> A >> B >> K;
	for (int i = 1; i <= min(A, B), i++) {
		if (A % i == 0 && B % i == 0)cnt++;
		if (cnt == K) {
			ans = i;
			break;
		}
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:44: error: expected ';' before ')' token
   10 |         for (int i = 1; i <= min(A, B), i++) {
      |                                            ^
      |                                            ;
Language: Java

import java.util.*;
class Main｛
  public static void main(String[] args)｛
      Scanner sc = new Scanner(System.in);
      int a = sc.nextInt();
      int b = sc.nextInt();
      int k = sc.nextInt();
      int cnt = 0;
      int ans = 0;
      
      if(a > b){
          for(int i = a;i > 0;i--){
              if(a%i == 0 && b%i == 0){
                  ans = i;
                  cnt++;
              }
              if(cnt == k)
                break;
          }
      }else{
          for(int i = b;i > 0;i--){
             if(a%i == 0 && b%i == 0){
                  ans = i;
                  cnt++;
              }
              if(cnt == k)
                break;
          }
      }
     System.out.println(ans);
    ｝
｝

Compiler output:
Main.java:2: error: illegal character: '\uff5b'
class Main?
          ^
Main.java:3: error: illegal character: '\uff5b'
  public static void main(String[] args)?
                                        ^
Main.java:3: error: unnamed classes are a preview feature and are disabled by default.
  public static void main(String[] args)?
                ^
  (use --enable-preview to enable unnamed classes)
Main.java:11: error: class, interface, enum, or record expected
      if(a > b){
      ^
Main.java:12: error: class, interface, enum, or record expected
          for(int i = a;i > 0;i--){
                        ^
Main.java:12: error: class, interface, enum, or record expected
          for(int i = a;i > 0;i--){
                              ^
Main.java:15: error: class, interface, enum, or record expected
                  cnt++;
                  ^
Main.java:16: error: class, interface, enum, or record expected
              }
              ^
Main.java:19: error: class, interface, enum, or record expected
          }
          ^
Main.java:21: error: class, interface, enum, or record expected
          for(int i = b;i > 0;i--){
                        ^
Main.java:21: error: class, interface, enum, or record expected
          for(int i = b;i > 0;i--){
                              ^
Main.java:24: error: class, interface, enum, or record expected
                  cnt++;
                  ^
Main.java:25: error: class, interface, enum, or record expected
              }
              ^
Main.java:28: error: class, interface, enum, or record expected
          }
          ^
Main.java:31: error: illegal character: '\uff5d'
    ?
    ^
Main.java:32: error: illegal character: '\uff5d'
?
^
Main.java:32: error: reached end of file while parsing
?
 ^
17 errors
Language: C++

#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<numeric>
#include<string>
using namespace std;
int main(){
    int A,B<K;
    cin>>A>>B>>K;
    int cnt=0;
    for(int i=min(A,B);1<=i;i--){
        if(A%i==0 && B%i==0){
            cnt++;
            if(cnt==K){
                cout<<i<<endl;
                return 0;
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: expected initializer before '<' token
    8 |     int A,B<K;
      |            ^
a.cc:9:13: error: 'B' was not declared in this scope
    9 |     cin>>A>>B>>K;
      |             ^
a.cc:9:16: error: 'K' was not declared in this scope
    9 |     cin>>A>>B>>K;
      |                ^
a.cc:19:2: error: expected '}' at end of input
   19 | }
      |  ^
a.cc:7:11: note: to match this '{'
    7 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
inline int gcd(int a, int b) {
  return a < b ? gcd(b, a) : (b ? gcd(b, a%b) : a);
}
int main() {
  int a, b, k;
  cin >> a >> b >> k;
  cout << max(1, gcd(a, b) * ~-k)) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:34: error: expected ';' before ')' token
    9 |   cout << max(1, gcd(a, b) * ~-k)) << endl;
      |                                  ^
      |                                  ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int a,b,c,d;
  cin>>a>>b>>c;
  d=max(a,b)+1
  while(c>0){
    d--;
    if(a%d==0 && b%d==0) c--;
  }
  cout<<d;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:15: error: expected ';' before 'while'
    6 |   d=max(a,b)+1
      |               ^
      |               ;
    7 |   while(c>0){
      |   ~~~~~
Language: C

#include<stdio.h>
//abc120-A
/*
int main(void)
{
	int a, b, c,d;
	scanf("%d %d %d", &a, &b, &c);

	if (b >= a * c)
	{
		printf("%d", c);
	}

	else
	{
		d = b / a;
		printf("%d", d);
	}
	return 0;
}*/
//abc120-B
int main(void)
{
	int a, b, k, tmp;
	int ans = 0, i, j;

	scanf_s("%d %d %d", &a, &b, &k);

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

	for (i = b; i > 0; i--)
	{
		if ((a % i + b % i) == 0)
		{
			ans += 1;
		}
		if (ans == k)
		{
			break;
		}

	}
	printf("%d", i);
	return 0;
}

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

#include <iostream>

using namespace std;

int main(){

  int a,b,k;
  int counts=0;
  
  cin >> a >> b >> k;
  
  for(i=1;i<=100;i++){
   if(a%i==0&&b%i==0){
   counts++; 
   }
   if(counts==k){ 
  cout << i << endl;
     break;
     }
    }
}


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

#include <stdio.h>

int main() {
  int a=0, b=0, k=0, count=0;
  scanf("%d %d %d", &a, &b, &k);
  for (int i=1; i<101; i++) {
    if (a%i == 0 && b%i == 0) {
      count++;
      if (count == k) {
        printf("%d\n", i);
        return 0;
      }
    }
  }
  printf("ans not found\n")
  return 0;
}  
       

Compiler output:
main.c: In function 'main':
main.c:15:28: error: expected ';' before 'return'
   15 |   printf("ans not found\n")
      |                            ^
      |                            ;
   16 |   return 0;
      |   ~~~~~~
Language: C++

import fractions as f
a,b,k = (int(j) for j in input().split())
c = f.gcd(a,b)
count = 1
d = c
while count < k:
    d = d - 1
    if c % d == 0:
        count = count + 1
print(d)

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

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int K = sc.nextInt();

		int t = Math.min(A, B);
		int cnt = 0;
		while (cnt < K) {
			if (A % t == 0 && B % t == 0)
				cnt++;
			t--;
		}

		System.out.println(t + 1);

		sc.close();
	}
}

Compiler output:
Main.java:3: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:10:21: error: invalid operands to binary % (have 'double' and 'double')
   10 |     ans = (double)a % (double)i;
      |           ~~~~~~~~~ ^ ~~~~~~~~~
      |           |           |
      |           double      double
main.c:12:23: error: invalid operands to binary % (have 'double' and 'double')
   12 |       ans = (double)b % (double)i;
      |             ~~~~~~~~~ ^ ~~~~~~~~~
      |             |           |
      |             double      double
Language: C

#include<stdio.h>
int main(void){
  int a, b, c:
  scanf("%d %d %d", &a, &b, &c);
  
  double ans;
  int i;
  int cnt;
  for(i = 1; i <= 100; i++){
    ans = (double)a % i;
    if(ans == 0){
      ans = (double)b % i;
      if(ans == 0){
        cnt++;
        if(cnt == c){
          printf("%d\n", i);
          break;
        }
      }
    }
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:3:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
    3 |   int a, b, c:
      |              ^
main.c:10:21: error: invalid operands to binary % (have 'double' and 'int')
   10 |     ans = (double)a % i;
      |           ~~~~~~~~~ ^
      |           |
      |           double
main.c:12:23: error: invalid operands to binary % (have 'double' and 'int')
   12 |       ans = (double)b % i;
      |             ~~~~~~~~~ ^
      |             |
      |             double
main.c:15:19: error: 'c' undeclared (first use in this function)
   15 |         if(cnt == c){
      |                   ^
main.c:15:19: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main(){
  int a,b,k;
  cin >> a>> b>> k;
  vector <int> ans;
  for(int i=1;i<min(a,b);i++){
    if(a%i==0 && b%i==0) ans.push_back();
  }
  cout << ans[ans.size()-k];
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:39: error: no matching function for call to 'std::vector<int>::push_back()'
   10 |     if(a%i==0 && b%i==0) ans.push_back();
      |                          ~~~~~~~~~~~~~^~
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:7: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note:   candidate expects 1 argument, 0 provided
Language: C++

#include<iostream>
#include<algrithm>
#include<vector>
using namespace std;
int main(){
  int a,b,k;
  cin >> a>> b>> k;
  vector <int> ans;
  for(int i=1;i<min(a,b);i++){
    if(a%i==0 && b%i==0) ans.push_back();
  }
  cout << ans[ans.size()-k];
}


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

#include <bits/stdc++.h>

using namespace std;

int main()
{
 	int a,b,k;
  cin>>a>>b>>c;
  vector<int> v;
  for(int i=0; i<=min(a,b); i++)
  {
    if(a%i==0 && b%i==0)
    {
     	v.push_back(i); 
    }
  }
  sort(v.begin(),v.end());
  reverse(v.begin(),v.end());
  cout<<v[k-1]<<endl;
  return 0;
}

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

#include <iostream>
#include <vector>
using namespace std;
int main(void){
  int a,b,c;
  cin >> a >> b >> c;
  
  int p=0;
  vector<int> com;
  
  for(int i=1;i<=100;i++){
    if(a % i == 0 && b % i == 0){
      com[p] = i;
      p++;
    }
  }

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

#include <iostream>
#include <vector>
using namespace std;
int main(void){
  int a,b,c;
  cin >> a >> b >> c;
  
  int p=0;
  vector<int> com[c];
  
  for(int i=1;i<=100;i++){
    if(a % i == 0 && b % i == 0){
      com[p] = i;
      p++;
    }
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: no match for 'operator=' (operand types are 'std::vector<int>' and 'int')
   13 |       com[p] = i;
      |                ^
In file included from /usr/include/c++/14/vector:72,
                 from a.cc:2:
/usr/include/c++/14/bits/vector.tcc:210:5: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = int; _Alloc = std::allocator<int>]'
  210 |     vector<_Tp, _Alloc>::
      |     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:211:42: note:   no known conversion for argument 1 from 'int' to 'const std::vector<int>&'
  211 |     operator=(const vector<_Tp, _Alloc>& __x)
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66:
/usr/include/c++/14/bits/stl_vector.h:766:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = int; _Alloc = std::allocator<int>]'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:766:26: note:   no known conversion for argument 1 from 'int' to 'std::vector<int>&&'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |                 ~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:788:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = int; _Alloc = std::allocator<int>]'
  788 |       operator=(initializer_list<value_type> __l)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:788:46: note:   no known conversion for argument 1 from 'int' to 'std::initializer_list<int>'
  788 |       operator=(initializer_list<value_type> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
a.cc:16:4: error: expected '}' at end of input
   16 |   }
      |    ^
a.cc:4:15: note: to match this '{'
    4 | int main(void){
      |               ^
Language: C++

#include <iostream>
using namespace std;
int main(void){
  int a,b,c;
  cin >> a >> b >> c;
  
  int p=0;
  vector<int> com[c];
  
  for(int i=1;i<=100;i++){
    if(a % i == 0 && b % i == 0){
      com[p] = i;
      p++;
    }
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector<int> com[c];
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vector<int> com[c];
      |          ^~~
a.cc:12:7: error: 'com' was not declared in this scope
   12 |       com[p] = i;
      |       ^~~
a.cc:15:4: error: expected '}' at end of input
   15 |   }
      |    ^
a.cc:3:15: note: to match this '{'
    3 | int main(void){
      |               ^
Language: C++

#include <iostream>
using namespace std;
int main(void){
  int a,b,c;
  cin >> a >> b >> c;
  
  int p=0;
  int com[c];
  
  for(int i=1;i<=100;i++){
    if(a % i == 0 && b % i = 0){
      com[p] = i;
      p++;
    }
    else
      p++;
    
    if(p == c)
      break;
  }
  cout << com[c-1] << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: lvalue required as left operand of assignment
   11 |     if(a % i == 0 && b % i = 0){
      |        ~~~~~~~~~~~^~~~~~~~
Language: C++

#include <iostream>
using namespace std;
int main(void){
  int a,b,c;
  cin >> a >> b >> c;
  
  int p=0;
  int com[c]
  
  for(int i=1;i<=100;i++){
    if(a % i == 0 && b % i = 0){
      com[p] = i;
      p++;
    }
    else
      p++;
    
    if(p == c)
      break;
  }
  cout << com[c-1] << endl;
  return 0;
}
    


Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: expected initializer before 'for'
   10 |   for(int i=1;i<=100;i++){
      |   ^~~
a.cc:10:15: error: 'i' was not declared in this scope
   10 |   for(int i=1;i<=100;i++){
      |               ^
a.cc:21:11: error: 'com' was not declared in this scope
   21 |   cout << com[c-1] << endl;
      |           ^~~
Language: C++

#include <iostream>
using namespace std;
int main(void){
  int a,b,c;
  cin >> a >> b >> c;
  
  int p=0;
  int com[c]
  
  for(int i=1;i<=100;i++){
    if(a % i == 0 && b % i = 0){
      com[p] = i;
      p++;
    }
    else
      p++;
    
    if(p == c)
      break;
  }
  cout << com[c-1] << endl;
  return 0;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: expected initializer before 'for'
   10 |   for(int i=1;i<=100;i++){
      |   ^~~
a.cc:10:15: error: 'i' was not declared in this scope
   10 |   for(int i=1;i<=100;i++){
      |               ^
a.cc:21:11: error: 'com' was not declared in this scope
   21 |   cout << com[c-1] << endl;
      |           ^~~
Language: C++

#include <iostream>
using namespace std;
int main(void){
  int a,b,c;
  cin >> a >> b >> c;
  
  int p=0;
  int com[c]
  
  for(int i=1;i<=100,i++){
    if(a % i == 0 && b % i = 0){
      com[p] = i;
      p++;
    }
    else
      p++;
    
    if(p == c)
      break;
  }
  cout << com[c-1] << endl;
  return 0;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: expected initializer before 'for'
   10 |   for(int i=1;i<=100,i++){
      |   ^~~
a.cc:10:15: error: 'i' was not declared in this scope
   10 |   for(int i=1;i<=100,i++){
      |               ^
a.cc:21:11: error: 'com' was not declared in this scope
   21 |   cout << com[c-1] << endl;
      |           ^~~
Language: C++

1 #include <stdio.h>
  2 
  3 int main(void)
  4 {
  5         int A,B,K,x,y,t, m;
  6 
  7         scanf("%d %d %d",&A,&B,&K);
  8 
  9         y=0;
 10 
 11         m = A;
 12         if (B<m) m = B;
 13 
 14                 for(x=m;x>0;x--){
 15                         if(A%x==0 && B%x==0){
 16                                 y++;
 17                                 if(y==K)
 18                                         printf("%d\n",x);
 19                         }
 20                 }
 21 }


Compiler output:
a.cc:1:3: error: stray '#' in program
    1 | 1 #include <stdio.h>
      |   ^
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 1 #include <stdio.h>
      | ^
Language: C++

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

int main(){
  int A, B, K, c, re;
  cin >> A >> B >> K;
  
  c = gcd(A, B);
  
  for (i = 1; i <= c; i++){
    if(c%i == 0){
      K--;
    }
    if(K == 0){
      re = i;
      break;
    }
  }
  
  cout << re;
  return 0;
}

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

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

int main(){
  int A, B, K, c, re;
  cin >> A >> B >> K;
  
  c = std::gcd(A, B);
  
  for (i = 1; i <= c; i++){
    if(c%i == 0){
      K--;
    }
    if(K == 0){
      re = i;
      break;
    }
  }
  
  cout << re;
  return 0;
}

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

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

int main(){
  int A, B, K, c, re;
  cin >> A >> B >> K;
  
  c = gcd(A, B);
  
  for (i = 1; i <= c; i++){
    if(c%i == 0){
      K--;
    }
    if(K == 0){
      re = i;
      break;
    }
  }
  
  cout << re;
  return 0;
}

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

using System;
using System.Linq;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            var array = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int a = array[0], b = array[1], k = array[2];
            var answers = from i in Enumerable.Range(1, 100)
                          where a % i == 0 && b % i == 0
                          orderby i descending
                          select i;
            Console.WriteLine(answers.ElementAt(k - 1));
        }
    }
}

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
    2 | using System.Linq;
      |       ^~~~~~
a.cc:8:26: error: 'string' has not been declared
    8 |         static void Main(string[] args)
      |                          ^~~~~~
a.cc:8:35: error: expected ',' or '...' before 'args'
    8 |         static void Main(string[] args)
      |                                   ^~~~
a.cc:18:6: error: expected ';' after class definition
   18 |     }
      |      ^
      |      ;
a.cc: In static member function 'static void ConsoleApp1::Program::Main(int*)':
a.cc:10:13: error: 'var' was not declared in this scope
   10 |             var array = Console.ReadLine().Split().Select(int.Parse).ToArray();
      |             ^~~
a.cc:11:21: error: 'array' was not declared in this scope
   11 |             int a = array[0], b = array[1], k = array[2];
      |                     ^~~~~
a.cc:12:17: error: expected ';' before 'answers'
   12 |             var answers = from i in Enumerable.Range(1, 100)
      |                 ^~~~~~~
a.cc:16:13: error: 'Console' was not declared in this scope
   16 |             Console.WriteLine(answers.ElementAt(k - 1));
      |             ^~~~~~~
a.cc:16:31: error: 'answers' was not declared in this scope
   16 |             Console.WriteLine(answers.ElementAt(k - 1));
      |                               ^~~~~~~
a.cc:16:49: error: 'k' was not declared in this scope
   16 |             Console.WriteLine(answers.ElementAt(k - 1));
      |                                                 ^
Language: C++

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

int main(){
  int a,b,c,f,e;
 cin>>a>>b>>c;
  f=min(a,b)
  vector<int>d(f+1);
  d[0]=0;
  e=0;
  for(int i=1;i<f+1;i++){
  if(a%i==0&&b%i==0){
    d[i]=i;
  }
    
    }
  for(int i=1;i<f+1;i++){
    
    if(d[i]!=0){
    continue;
    }
 else{
 e++;
 if(e=c){
 i=e;
   break;
 }
 }
    }
  cout<<e<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:13: error: expected ';' before 'vector'
    7 |   f=min(a,b)
      |             ^
      |             ;
    8 |   vector<int>d(f+1);
      |   ~~~~~~     
a.cc:9:3: error: 'd' was not declared in this scope
    9 |   d[0]=0;
      |   ^
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;

int main(){
  int x,y,k;
  int i;
  vector <int> v;
  
  cin>>x>>y>>k;
  for(i=1;i<=min({x,y});i++){
    if(x%i==0&&y%i==0)
      v.push_back(i);
  }
  sort(v.begin(),v.end,greater(int));
  cout<<v[k-1]<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:31: error: missing template arguments before '(' token
   17 |   sort(v.begin(),v.end,greater(int));
      |                               ^
a.cc:17:32: error: expected primary-expression before 'int'
   17 |   sort(v.begin(),v.end,greater(int));
      |                                ^~~
Language: C++

#include<iostream>
#include <queue>
using namespace std;
int main()
{
  int a,b,k,j;
  int q[100];
  j=0;
  cin >> a >> b >> k;
  for(int i=a; i>0; --i){
    if((a%i==0)&&(b%i==0))
    {
      q(j)=i;
      j++;
    }else{
    }
  }
  cout << q[k-1];
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:8: error: 'q' cannot be used as a function
   13 |       q(j)=i;
      |       ~^~~
Language: C++

#include<iostream>
#include <queue>
using namespace std;
int main()
{
  int a,b,k,ans;
  queue<int> q;
  cin >> a >> b >> k;
  for(int i=a; i>0; --i){
    if((a%i==0)&&(b%i==0))
    {
      q.push (i);
    }else{
    }
  }
  cout << q[k-1];
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:12: error: no match for 'operator[]' (operand types are 'std::queue<int>' and 'int')
   16 |   cout << q[k-1];
      |            ^
Language: C++

#include<iostream>
#include <queue>
using namespace std;
int main()
{
  int a,b,k,ans;
  queue<int> q;
  cin >> a >> b >> k;
  for(int i=a,i>0,--i){
    if((a%i==0)&&(b%i==0))
    {
      q1.push (i);
    }else{
    }
  }
  cout << q[k-1];
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:16: error: expected ';' before '>' token
    9 |   for(int i=a,i>0,--i){
      |                ^
      |                ;
a.cc:9:16: error: expected primary-expression before '>' token
a.cc:9:22: error: expected ';' before ')' token
    9 |   for(int i=a,i>0,--i){
      |                      ^
      |                      ;
a.cc:12:7: error: 'q1' was not declared in this scope; did you mean 'q'?
   12 |       q1.push (i);
      |       ^~
      |       q
a.cc:16:12: error: no match for 'operator[]' (operand types are 'std::queue<int>' and 'int')
   16 |   cout << q[k-1];
      |            ^
Language: C++

#include<iostream>
#include <queue>
using namespace std;
int main()
{
  int a,b,k,ans;
  queue<int> q;
  cin >> a >> b >> k;
  for(i=a,--i,i>0){
    if((a%i==0)&&(b%i==0))
    {
      q1.push (i);
    }else{
    }
  }
  cout << q[k-1];
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: 'i' was not declared in this scope
    9 |   for(i=a,--i,i>0){
      |       ^
a.cc:16:12: error: no match for 'operator[]' (operand types are 'std::queue<int>' and 'int')
   16 |   cout << q[k-1];
      |            ^
a.cc:17:3: error: expected primary-expression before 'return'
   17 |   return 0;
      |   ^~~~~~
a.cc:16:18: error: expected ')' before 'return'
   16 |   cout << q[k-1];
      |                  ^
      |                  )
   17 |   return 0;
      |   ~~~~~~          
a.cc:9:6: note: to match this '('
    9 |   for(i=a,--i,i>0){
      |      ^
Language: C++

int A, B, K;
    int count = 0;
    cin >> A >> B >> K;

        for (int i = 1;; i++) {
        
            if (A%i == 0 && B%i == 0) {
                count += 1;
                if (count == K) {
                    cout << i << endl;

                    break;
                }
            }
        }

Compiler output:
a.cc:3:5: error: 'cin' does not name a type
    3 |     cin >> A >> B >> K;
      |     ^~~
a.cc:5:9: error: expected unqualified-id before 'for'
    5 |         for (int i = 1;; i++) {
      |         ^~~
a.cc:5:26: error: 'i' does not name a type
    5 |         for (int i = 1;; i++) {
      |                          ^
Language: C++

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

int main() {
 int A,B,K;
 cin >> A >> B >> K;
 int count;
 for(int i=1;i <101 ; i++)
   if(A%i==0 && B%i==0){
    count++;
     if(count < K){
     continue;
     }
     if(count == K){
     cout << count << endl;
     break;
     }
   }
  if(A%i !=0 ||B%i !=0){
  continue;
  }
}




Compiler output:
a.cc: In function 'int main()':
a.cc:19:8: error: 'i' was not declared in this scope
   19 |   if(A%i !=0 ||B%i !=0){
      |        ^
a.cc:20:3: error: continue statement not within a loop
   20 |   continue;
      |   ^~~~~~~~
Language: C++

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

int main() {
 int A,B,K;
 cin >> A >> B >> K;
 int count=0;
 for(int i=1;i <101 ; i++)
   if(A%i==0 && B%i==0){
    count++;
     if(count < K){
     continue;
     }
     if(count == K){
     cout << count << endl;
     break;
     }
   }
  else(A%i !=0 ||B%i !=0){
  continue;
  }
}




Compiler output:
a.cc: In function 'int main()':
a.cc:19:26: error: expected ';' before '{' token
   19 |   else(A%i !=0 ||B%i !=0){
      |                          ^
      |                          ;
Language: C++

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

int main() {
 int A,B,K;
 cin >> A >> B >> K;
 int count;
 for(int i=1;i <101 ; i++)
   if(A%i==0 && B%i==0){
    count++;
     if(count < K){
     continue;
     }
     if(count == K){
     cout << count << endl;
     break;
     }
   }
  else(A%i !=0 ||B%i !=0){
  continue;
  }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:19:26: error: expected ';' before '{' token
   19 |   else(A%i !=0 ||B%i !=0){
      |                          ^
      |                          ;
Language: C++

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

int main() {
 int A,B,K;
 cin >> A >> B >> K;
 int count;
 for(int i=1;i <101 ; i++)
   if(A%i==0 && B%i==0){
    count++;
     if(count < K){
     continue;
     }
     if(count == K){
     cout << count << endl;
     break;
     }
   }
  else(){
  continue;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:8: error: expected primary-expression before ')' token
   19 |   else(){
      |        ^
Language: C++

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

int main(){
 
  for(int i=1;i<K+1;i++){
     int A,B,K;
  int count;
  cin>>A>>B>>K;
    if(A%i==0&&B%i==0){
      count+=1
        if (count==K){
          cout<<i<<endl;
        }
      break;
    }
  }
      
  

Compiler output:
a.cc: In function 'int main()':
a.cc:6:17: error: 'K' was not declared in this scope
    6 |   for(int i=1;i<K+1;i++){
      |                 ^
a.cc:11:15: error: expected ';' before 'if'
   11 |       count+=1
      |               ^
      |               ;
   12 |         if (count==K){
      |         ~~     
a.cc:17:4: error: expected '}' at end of input
   17 |   }
      |    ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

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

int main(){
 
  for(int i=1;;i++){
     intA,B,K;
  int count;
  cin>>A>>B>>K;
    if(A%i==0&&B%i==0){
      count+=1
        if (count==K){
          cout<<i<<endl;
        }
      break;
    }
  }
      
  

Compiler output:
a.cc: In function 'int main()':
a.cc:7:6: error: 'intA' was not declared in this scope; did you mean 'int'?
    7 |      intA,B,K;
      |      ^~~~
      |      int
a.cc:7:11: error: 'B' was not declared in this scope
    7 |      intA,B,K;
      |           ^
a.cc:7:13: error: 'K' was not declared in this scope
    7 |      intA,B,K;
      |             ^
a.cc:9:8: error: 'A' was not declared in this scope
    9 |   cin>>A>>B>>K;
      |        ^
a.cc:11:15: error: expected ';' before 'if'
   11 |       count+=1
      |               ^
      |               ;
   12 |         if (count==K){
      |         ~~     
a.cc:17:4: error: expected '}' at end of input
   17 |   }
      |    ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

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

int main(){
  intA,B,K;
  int count;
  cin>>A>>B>>K;
  for(int i=1;;i++){
    if(A%i==0&&B%i==0){
      count+=1
        if (count==K){
          cout<<i<<endl;
        }
      break;
    }
  }
      
  

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'intA' was not declared in this scope; did you mean 'int'?
    5 |   intA,B,K;
      |   ^~~~
      |   int
a.cc:5:8: error: 'B' was not declared in this scope
    5 |   intA,B,K;
      |        ^
a.cc:5:10: error: 'K' was not declared in this scope
    5 |   intA,B,K;
      |          ^
a.cc:7:8: error: 'A' was not declared in this scope
    7 |   cin>>A>>B>>K;
      |        ^
a.cc:10:15: error: expected ';' before 'if'
   10 |       count+=1
      |               ^
      |               ;
   11 |         if (count==K){
      |         ~~     
a.cc:16:4: error: expected '}' at end of input
   16 |   }
      |    ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: Java

import java.util.Arrays;
import java.util.Scanner;
public class Main {
	static int A,B,C;
	//static String ans;
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		A=sc.nextInt();
		B=sc.nextInt();
 
		C=sc.nextInt();
		int a[]=new int[101];
		for(int i=1;i<=100;i++) {
			if(A%i==0&&B%i==0)a[i]=i;
		}
		Arrays.sort(a);
		System.out.println(a[101-C]);
	}
}
import java.util.Arrays;
import java.util.Scanner;
public class Main {
	static int A,B,C;
	//static String ans;
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		A=sc.nextInt();
		B=sc.nextInt();

		C=sc.nextInt();
		int a[]=new int[101];
		for(int i=1;i<=100;i++) {
			if(A%i==0&&B%i==0)a[i]=i;
		}
		Arrays.sort(a);
		System.out.println(a[101-C]);
	}
}

Compiler output:
Main.java:20: error: class, interface, enum, or record expected
import java.util.Arrays;
^
Main.java:21: error: class, interface, enum, or record expected
import java.util.Scanner;
^
2 errors
Language: C++

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

int main(){
  	int A, B, K;
  	cin >> A >> B >> K;
  	
  	int G;
  	G = gcd(A,B);
  	vector<int> div;
  	for(int i=1; i<=G; i++){
    	if(G%i == 0){
        	div.push_back(G/i);
        }
    }
  	
  	cout << div[K-1] << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'vector' was not declared in this scope
   11 |         vector<int> div;
      |         ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    2 | #include <numeric>
  +++ |+#include <vector>
    3 | using namespace std;
a.cc:11:16: error: expected primary-expression before 'int'
   11 |         vector<int> div;
      |                ^~~
a.cc:14:21: error: overloaded function with no contextual type information
   14 |                 div.push_back(G/i);
      |                     ^~~~~~~~~
a.cc:18:20: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   18 |         cout << div[K-1] << endl;
      |                    ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a,b,c;
  cin>>a>>b>>c;
  int cnt=0;
  for(i=min(a,b);i>0;i--){
    if(a%i==0&&b%i==0)
      cnt++;
    if(cnt==c){
      cout<<i<<endl;
      break;
    }
  }
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: 'i' was not declared in this scope
    8 |   for(i=min(a,b);i>0;i--){
      |       ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a,b,c
  cin>>a>>b>>c;
  int cnt=0;
  for(int i=min(a,b);i>0;i--){
    if(a%i==0&&b%i==0)
      cnt++;
    if(cnt==c){
      cout<<i<<endl;
      break;
    }
  }
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'cin'
    6 |   cin>>a>>b>>c;
      |   ^~~
a.cc:11:13: error: 'c' was not declared in this scope
   11 |     if(cnt==c){
      |             ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a,b,c
  cin>>a>>b>>c;
  int cnt=0;
  for(i=min(a,b);i>0;i--){
    if(a%i==0&&b%i==0)
      cnt++;
    if(cnt==c){
      cout<<i<<endl;
      break;
    }
  }
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'cin'
    6 |   cin>>a>>b>>c;
      |   ^~~
a.cc:8:7: error: 'i' was not declared in this scope
    8 |   for(i=min(a,b);i>0;i--){
      |       ^
a.cc:11:13: error: 'c' was not declared in this scope
   11 |     if(cnt==c){
      |             ^
Language: C

    #include<stdio.h>
    int main(void){
     int a,b,c[100],k,i,j=0;
    scanf("%d%d%d",&a,&b,&k);
    if(a>b) { a=a+b; b=a-b; a=a-b;}
    for(i=1;i<=a;i++){
    if((a%i==0)&&(b%i==0))  {c[j]=i; j++;}
    printf("%d",c[j-k]);
    return 0;
    }

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

    #include<stdio.h>
    int main(void){
     int a,b,c[100],k,i,j=0;
    scanf("%d%d%d",&a,&b,&k);
    if(a>b) { a=a+b; b=a-b; a=a-b;}
    for(i=1;i<=a;i++){
    if((a%i==0)&&(b%i==0))  {c[j]=i; j++;}
    printf("%d",c[c-k]);
    return 0;
    }

Compiler output:
main.c: In function 'main':
main.c:8:18: error: array subscript is not an integer
    8 |     printf("%d",c[c-k]);
      |                  ^
main.c:10:5: error: expected declaration or statement at end of input
   10 |     }
      |     ^
Language: C

    #include<stdio.h>
    int main(void){
     int a,b,c[100],k,i,j=0;
    scanf("%d%d%d",&a,&b,&k);
    if(a>b) { a=a+b; b=a-b; a=a-b;}
    for(i=1;i<=a;i++){
    if((a%i==0)&&(b%i==0))  {c[j]=i; j++;}
    printf("%d",c[j-k]}
    return 0;
    }

Compiler output:
main.c: In function 'main':
main.c:8:23: error: expected ')' before '}' token
    8 |     printf("%d",c[j-k]}
      |           ~           ^
      |                       )
main.c:8:23: error: expected ';' before '}' token
    8 |     printf("%d",c[j-k]}
      |                       ^
      |                       ;