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

#include<stdio.h>
#include<stdlib.h>
int main(){
  int a,b,k;
  int i;
  scanf("%d %d %d",&a,&b,&k);
  int *sosuu;
  sosuu=malloc(k*sizeof(int));
  int max;
  if(a>b)
    max=a;
  else
    max=b;
  int count=0;
  for(i=2;i<max;i++){
    if(a%i==0&&b%i==0)
      sosuu[count++]=i;
    if(count==c)
      break;
  }
  printf("%d",sosuu[count-1]);
    	
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:18:15: error: 'c' undeclared (first use in this function)
   18 |     if(count==c)
      |               ^
main.c:18:15: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<bits/stdc++.h>
using namespace std;
using Int = long long;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);

int a,b,k;
cin >> a,b,k;

for(int i = min(a,b); ; i--){
if(a%i==0 && b%i=0){
k--;
if(k==0){
cout<<i;
break;
}
}
}

}

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

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

int main() {
  long A, B, K;
  cin >> A >> B >> K;
  int cnt = 0;
  for(int = max(A,B); i>0; i--){
    if(A%i==0 && B%i==0){
      cnt++;
      if(cnt==K){
        break;
      }
    }
  }
  cout << cnt;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: expected unqualified-id before '=' token
    8 |   for(int = max(A,B); i>0; i--){
      |           ^
a.cc:8:10: error: expected ';' before '=' token
    8 |   for(int = max(A,B); i>0; i--){
      |          ^~
      |          ;
a.cc:8:11: error: expected primary-expression before '=' token
    8 |   for(int = max(A,B); i>0; i--){
      |           ^
a.cc:8:23: error: 'i' was not declared in this scope
    8 |   for(int = max(A,B); i>0; i--){
      |                       ^
a.cc:8:26: error: expected ')' before ';' token
    8 |   for(int = max(A,B); i>0; i--){
      |      ~                   ^
      |                          )
a.cc:8:28: error: 'i' was not declared in this scope
    8 |   for(int = max(A,B); i>0; i--){
      |                            ^
Language: C++

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

int main() {
  long A, B, C;
  cin >> A >> B >> K;
  int cnt = 0;
  for(int = max(A,B); i>0; i--){
    if(A%i==0 && B%i==0){
      cnt++;
      if(cnt==K){
        break;
      }
    };
  }
  cout << cnt;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:20: error: 'K' was not declared in this scope
    6 |   cin >> A >> B >> K;
      |                    ^
a.cc:8:11: error: expected unqualified-id before '=' token
    8 |   for(int = max(A,B); i>0; i--){
      |           ^
a.cc:8:10: error: expected ';' before '=' token
    8 |   for(int = max(A,B); i>0; i--){
      |          ^~
      |          ;
a.cc:8:11: error: expected primary-expression before '=' token
    8 |   for(int = max(A,B); i>0; i--){
      |           ^
a.cc:8:23: error: 'i' was not declared in this scope
    8 |   for(int = max(A,B); i>0; i--){
      |                       ^
a.cc:8:26: error: expected ')' before ';' token
    8 |   for(int = max(A,B); i>0; i--){
      |      ~                   ^
      |                          )
a.cc:8:28: error: 'i' was not declared in this scope
    8 |   for(int = max(A,B); i>0; i--){
      |                            ^
Language: C++

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

int main() {
int a,b,m,k=1;
  cin >> a >> b >> m;
  for (int i=min(a,b); i!=0; i--){
  if(a%i==0&&b&i==0){
  if(k==m){
  cout << i << endl;
    return0;
  }
  }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'return0' was not declared in this scope
   11 |     return0;
      |     ^~~~~~~
Language: C++

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

int main() {
int a,b,m,k=1;
  cin >> a >> b >> m;
  for (int i=min(a,b); i!=0 i--){
  if(a%i==0&&b&i==0){
  if(k==m){
  cout << i << endl;
    return0;
  }
  }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:28: error: expected ';' before 'i'
    7 |   for (int i=min(a,b); i!=0 i--){
      |                            ^~
      |                            ;
a.cc:11:5: error: 'return0' was not declared in this scope
   11 |     return0;
      |     ^~~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:17:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   17 |     sort(div.begin(), div.end());
      |     ^~~~
      |     sqrt
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: redeclaration of 'int N'
    8 |   int N = 1;
      |       ^
a.cc:5:13: note: 'int N' previously declared here
    5 |   int A,B,K,N;
      |             ^
a.cc:10:19: error: lvalue required as left operand of assignment
   10 |     if (A % N = 0 && B % N = 0){
      |                 ~~^~~~~~~~
Language: C++

#include<bits/stdc++.h>

using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: 'i' was not declared in this scope
   16 |   cout<<i<<endl;
      |         ^
Language: C++

#include <iostream>
using namespace std;
 
int main () {
  int A,B,K;
  cin>>A>>B>>K;
  
  int minNum = A > B ? B : A;
  
  int count = 1;
  for(int d= minNum; d > 0; d--) {
  	if(A%d==0 && B%d == 0) {
      if(count == K) {
      	cout << A%d;
        break;
      }
      count++;
  }
  
  return 0;
}

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

#include <iostream>
using namespace std;
 
int main () {
  int A,B,K;
  cin>>A>>B>>C;
  
  int minNum = A > B ? B : A;
  
  int count = 1;
  for(int d= minNum; d > 0; d--) {
  	if(A%d==0 && B%d == 0) {
      if(count == K) {
      	cout << A%d;
        break;
      }
      count++;
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:14: error: 'C' was not declared in this scope
    6 |   cin>>A>>B>>C;
      |              ^
a.cc:21:2: error: expected '}' at end of input
   21 | }
      |  ^
a.cc:4:13: note: to match this '{'
    4 | int main () {
      |             ^
Language: C++

#include<iostream>
using namespace std;

int main(){
	int a,b,c,t,j = 0;
	cin >> a >> b >> c;
	if(a < b){t = a;a = b;b = t;}
	ANS[b] = {};
	for(int i = 1;i < b;i++){
		if(10*(b/i)%10 == 0){
			ANS[j] = i;
			j++;
		}
	}
	int k = 0;
	while(1){
		if(ANS[k] == 0)break;
		k++;
	}
	cout << ANS[k-c] << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'ANS' was not declared in this scope
    8 |         ANS[b] = {};
      |         ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int A,B,K;
  cin >> A >> B >> K;
  
  // 100から順に公約数を探す
  
  int cnt = 0; // 今まで見つかった数
  for(i = 100; i >= 1; i--){
    
    if(A % i == 0 && B % i == 0){
      cnt++; // 公約数が見つかったらcnt("何番目"のカウント)を1増やす
      if(cnt == K){
        cout << i << endl;
      }
    }
  }
}

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

#include <stdio.h>

int main(void) {
  int a, b, k, ans, max, min, i;

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

  if (a > b) {
    max = a;
    min = b;
  }else {
    max = b;
    min = a;
  }

  for (i = min; i > 0; i--) {
    if (max % i == 0 && min % i == 0) {
      k--;
    }
    if (k == 0) {
      printf("%d\n", i);
      break;
    }
  }

  return 0;

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: 'i' was not declared in this scope
    8 |   for(i=x;x>100;x--){
      |       ^
Language: Java

package AFavoriteSoundSample;

import java.util.ArrayList;
import java.util.Scanner;

public class BKthCommonDivisor {
	public static void main(String args[]) {
		Scanner scn = new Scanner(System.in);
		int a = scn.nextInt();
		int b = scn.nextInt();
		int k = scn.nextInt();

		ArrayList<Integer> list = new ArrayList<>();

		int i = 1;
		do {
			if (a % i == 0 && b % i == 0) {
				System.out.println(i);
				list.add(i);
			}
			i++;
		} while (i <= a);

		System.out.println(list.get((list.size()-k)));
	}
}

Compiler output:
Main.java:6: 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 arr[1024];
int main()
{
	int a,b,k,n=0;
	int i;
	scanf("%d %d %d",&a,&b,&k);
	for(i=1;i<=min(a,b);i++)
	{
		if(a%i==0&&b%i==0)
		{
			arr[n]=i;
			n++;
		}
	}
	printf("%d",arr[k-1]]);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:29: error: expected ')' before ']' token
   17 |         printf("%d",arr[k-1]]);
      |               ~             ^
      |                             )
Language: C++

#include<bits/stdc++.h>
using namespace std;
int a[1024];
int main()
{
	int a,b,k,n=0;
	int i;
	scanf("%d %d %d",&a,&b,&k);
	for(i=1;i<=min(a,b);i++)
	{
		if(a%i==0&&b%i==0)
		{
			a[n]=i;
			n++;
		}
	}
	printf("%d",a[k-1]);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:26: error: invalid types 'int[int]' for array subscript
   13 |                         a[n]=i;
      |                          ^
a.cc:17:22: error: invalid types 'int[int]' for array subscript
   17 |         printf("%d",a[k-1]);
      |                      ^
Language: C++

// ABC120_B
#include <iostream>
#include <algorithm>
using namespace std;
using ll = long long;

int main() {
    // input(sunippets: inpv, inpn, inps)
    ll A, B, K, cnt = 0;
    cin >> A >> B >> K;
    
    // calculation
    for (ll i = 1; i <= mix(A, B); ++i) {
        if (A%i == 0 && B%i == 0) cnt++;
        if (cnt == K) {
            cout << i << "\n";
            return 0;
        }
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:25: error: 'mix' was not declared in this scope
   13 |     for (ll i = 1; i <= mix(A, B); ++i) {
      |                         ^~~
Language: Java

import java.util.Scanner;

public class Msin {

    public static String process(TestCase testCase) {
        final int A = testCase.A;
        final int B = testCase.B;
        int K = testCase.K;

        final int range = Math.min(A, B);

        for (int i = range; i >= 1; ++i) {
            if ((A % i == 0) && (B % i == 0)) {
                K--;
                if (K == 0) {
                    return String.valueOf(i);
                }
            }

        }

        throw new IllegalArgumentException("no solution");
    }

    // Util func

    public static void main(String[] args) {
        TestCase testCase = readFromInput();

        final String result = process(testCase);

        output(result);
    }

    private static TestCase readFromInput() {
        Scanner sc = new Scanner(System.in);

        int A = sc.nextInt();
        int B = sc.nextInt();
        int K = sc.nextInt();

        return new TestCase(A, B, K);
    }

    private static IllegalArgumentException unknownN(int N) {
        return new IllegalArgumentException("Unknown N: " + N);
    }

    private static void output(String result) {
        System.out.println(result);
    }

    public static class TestCase {
        final int A;
        final int B;
        final int K;

        public TestCase(int A, int B, int K) {
            this.A = A;
            this.B = B;
            this.K = K;
        }
    }
}


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

#include<stdio.h>
int main(){
  int a,b,x,k,i,j=0,m;
  scanf("%d%d%d/n",&a,&b,&k)
  if(a>b){
      m=b;
      b=a;
      a=m;
    }
  x=b%a;
  while(x!=0){
    b=a;
    a=x;
    x=b%a;
  }
  for(i=a;j<k;i--){
    if(a%i==0){
      j++;
    }
  }
  printf("%d",i);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:29: error: expected ';' before 'if'
    4 |   scanf("%d%d%d/n",&a,&b,&k)
      |                             ^
      |                             ;
    5 |   if(a>b){
      |   ~~
Language: C++

#include<stdio.h>
int main(){
  int a,b,x,k,i,j=0,m;
  scanf(%d%d%d/n,&a,&b,&k)
  if(a>b){
      m=b;
      b=a;
      a=m;
    }
  x=b%a;
  while(x!=0){
    b=a;
    a=x;
    x=b%a;
  }
  for(i=a;j<k;i--){
    if(a%i==0){
      j++;
    }
  }
  printf("%d",i);
  return 0;
}
        

Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: expected primary-expression before '%' token
    4 |   scanf(%d%d%d/n,&a,&b,&k)
      |         ^
a.cc:4:10: error: 'd' was not declared in this scope
    4 |   scanf(%d%d%d/n,&a,&b,&k)
      |          ^
a.cc:4:16: error: 'n' was not declared in this scope
    4 |   scanf(%d%d%d/n,&a,&b,&k)
      |                ^
Language: C++

#include <iostream>
#include <math>
using namespace std;
int main(int argc, const char * argv[]) {
    int a, b, k;
    cin >> a >> b >> k;
    
    int cnt = 1, ans = 1;
    for (int i = 2; i <= min(a, b) && cnt != k; i++) {
        if (a % i == 0 && b % i == 0) {
            cnt++;
            ans = i;
        }
    }
    cout << ans << endl;
}


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

#include <bits/stdc++.h>


using namespace std;

#define endl '\n'
#define PB push_back
#define MP make_pair
#define LL long long
#define FOR(i,a,b) for(int i = (a); i <= (b); i++)
#define RE(i,n) FOR(i,1,n)
#define REP(i,n) FOR(i,0,(int)(n)-1)
#define R(i,n) REP(i,n)
#define VI vector<int>
#define PII pair<int,int>
#define LD long double
#define FI first
#define SE second
#define st FI
#define nd SE
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())



int main() {

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout << setprecision(5);
    cout << fixed;

    int a, b, k;

    cin >> a >> b >> k;

    for(int i = min(a, b); >= 1; i--) {

        if(a%i == 0 && b%i == 0) {

                k--;
                if(k == 0) {

                    cout << i << endl;
                    return 0;
                }
        }

    }


    return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:37:28: error: expected primary-expression before '>=' token
   37 |     for(int i = min(a, b); >= 1; i--) {
      |                            ^~
Language: C++

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

int int main(){

  int A, B, K;
  cin >> A >> B >> K;

  int cnt = 0; //今まで見つかった数
  for (int i = min(A, B); i >= 1; i--){
    if (A % i == 0 && B % i ==0){
      cnt++;  //cntを1増やす
      if (cnt == K){
        cout << i << endl;
        return 0;
      }
    }
  }
}

Compiler output:
a.cc:7:1: error: two or more data types in declaration of 'main'
    7 | int int main(){
      | ^~~
Language: C++

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

int int main(){

  int A, B, K;
  cin >> A >> B >> K;

  int cnt = 0; //今まで見つかった数
  for (int i = min(A, B); i >= 1; i--){
    if (A % i == 0 && B % i ==0){
      cnt++;  //cntを1増やす
      if (cnt == K){
        cout << i << endl;
        return;
      }
    }
  }
}


Compiler output:
a.cc:7:1: error: two or more data types in declaration of 'main'
    7 | int int main(){
      | ^~~
Language: C++

#include<algorithm>
#include<iostream>
#include<functional>
#include<cmath>
#include<iomanip>
using namespace std;
int main(){
  int a,b,d,x,y,count=0;
  cin>>a>>b>>d;
  x=__gcd(a,b);
  for(int i=x;i>0;i--){
    if(x%i==0){
      count++;
      y=i;
    }
    if(count==c)
      break;
  }
  cout<<y<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:15: error: 'c' was not declared in this scope
   16 |     if(count==c)
      |               ^
Language: C++

#include <iostream> 
#include <iomanip> 
#include <vector> 
#include <algorithm> 
#include <numeric> 
#include <functional> 
#include <cmath> 
#include <queue> 
#include <stack> 

#define Ford(i,a,b) for (int i=(a);i<(b);i++) 
#define For(i,n) Ford(i,0,n) 
typedef long long ll; 

using namespace std;

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



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

#include <iostream> 
#include <iomanip> 
#include <vector> 
#include <algorithm> 
#include <numeric> 
#include <functional> 
#include <cmath> 
#include <queue> 
#include <stack> 

#define Ford(i,a,b) for (int i=(a);i<(b);i++) 
#define For(i,n) Ford(i,0,n) 
typedef long long ll; 

using namespace std;

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


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

#include <iostream> 
#include <iomanip> 
#include <vector> 
#include <algorithm> 
#include <numeric> 
#include <functional> 
#include <cmath> 
#include <queue> 
#include <stack> 

#define Ford(i,a,b) for (int i=(a);i<(b);i++) 
#define For(i,n) Ford(i,0,n) 
typedef long long ll; 

using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:23:27: error: expected ';' before ':' token
   23 |     if(k==0) cout<<i<<endl:
      |                           ^
      |                           ;
Language: C++

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

int main(int argc, char const *argv[])
{	
	int a,b,k;
	int p = 0;
	vector<int> v(100);
	cin >> a >> b >> c;
	for (int i = 1; i < ((a < b) ? a : b); ++i)
	{
		if(!(a % i) && !(b % i))	v.at(++p) = i;	
	}
	cout << v.at(p - k) << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:9:26: error: 'c' was not declared in this scope
    9 |         cin >> a >> b >> c;
      |                          ^
Language: C++

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

int main(){

    int a , b, k;

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

    int cnt = 0; //見つかった数
    for (int i=0; i>=1; i--){
        if (a%i==0 && b%i==0){
            cnt++;
            if(cnt == k){
                printf("%d",i)
            }
        }
    }
}

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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int A,B,K;
  int h=0;
  int a[20];
  cin >> A >> B >> K ;
  
  if(A>B) i=B;
  else if(B>A) i=A;
  else i=A;
  
  //A,B入力
  //K番目に大きい数字
  //AとBの最小公倍数を求める
  while(1){
    if(i==0){
      a[h]=i;
      break;
    }
  	if(A%i==0 && B%i==0) {
      a[h]=i;
      h++;
    }
    i--;
  }
  cout << a[K] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:11: error: 'i' was not declared in this scope
   10 |   if(A>B) i=B;
      |           ^
a.cc:11:16: error: 'i' was not declared in this scope
   11 |   else if(B>A) i=A;
      |                ^
a.cc:12:8: error: 'i' was not declared in this scope
   12 |   else i=A;
      |        ^
a.cc:18:8: error: 'i' was not declared in this scope
   18 |     if(i==0){
      |        ^
a.cc:22:14: error: 'i' was not declared in this scope
   22 |         if(A%i==0 && B%i==0) {
      |              ^
a.cc:26:5: error: 'i' was not declared in this scope
   26 |     i--;
      |     ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int A,B,K;
  int h=0;
  int a[20];
  cin >> A >> B >> K ;
  
  if(A>B) i=B;
  else if(B<A) i=A;
  else i=A;
  
  //A,B入力
  //K番目に大きい数字
  //AとBの最小公倍数を求める
  while(1){
    if(i==0){
      a[h]=i;
      break;
    }
  	if(A%i==0 && B%i==0) {
      a[h]=i;
      h++;
    }
    i--;
  }
  cout << a[K] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:11: error: 'i' was not declared in this scope
   10 |   if(A>B) i=B;
      |           ^
a.cc:11:16: error: 'i' was not declared in this scope
   11 |   else if(B<A) i=A;
      |                ^
a.cc:12:8: error: 'i' was not declared in this scope
   12 |   else i=A;
      |        ^
a.cc:18:8: error: 'i' was not declared in this scope
   18 |     if(i==0){
      |        ^
a.cc:22:14: error: 'i' was not declared in this scope
   22 |         if(A%i==0 && B%i==0) {
      |              ^
a.cc:26:5: error: 'i' was not declared in this scope
   26 |     i--;
      |     ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int A,B,K;
  int i;
  int h=0;
  int a[10];
  cin >> A >> B >> K ;
  int i=A;
  //A,B入力
  //K番目に大きい数字
  //AとBの最小公倍数を求める
  while(1){
  	if(A%i==0 && B%i==0) {
      a[h]=i;
      h++;
    }
    i--;
    if(i==0) break;
  }
  
  cout << a[K] << endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:7: error: redeclaration of 'int i'
   10 |   int i=A;
      |       ^
a.cc:6:7: note: 'int i' previously declared here
    6 |   int i;
      |       ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int A,B,K;
  int i;
  int h=0;
  int a[10];
  cin >> A >> B >> K ;
  int i=A;
  //A,B入力
  //K番目に大きい数字
  //AとBの最小公倍数を求める
  while(1){
  	if(A%i==0 && B%i==0){
      a[h]=i;
    }
    i--;
    h++;
    if(i==0) break;
  }
  
  cout << a[K] << endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:7: error: redeclaration of 'int i'
   10 |   int i=A;
      |       ^
a.cc:6:7: note: 'int i' previously declared here
    6 |   int i;
      |       ^
Language: C++

#include<iostream>
using namespace std;

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

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

  cout << i << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: 'tem' was not declared in this scope; did you mean 'tm'?
   12 |     tem=b;
      |     ^~~
      |     tm
Language: Java

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

Compiler output:
Main.java:5: error: cannot find symbol
  a=sc.nextInt();b=sc.nextInt();int k=sc.nextInt();
  ^
  symbol:   variable a
  location: class Main
Main.java:5: error: cannot find symbol
  a=sc.nextInt();b=sc.nextInt();int k=sc.nextInt();
                 ^
  symbol:   variable b
  location: class Main
Main.java:8: error: cannot find symbol
  	if(a%i==0&&b%i==0){
  	   ^
  symbol:   variable a
  location: class Main
Main.java:8: error: cannot find symbol
  	if(a%i==0&&b%i==0){
  	           ^
  symbol:   variable b
  location: class Main
4 errors
Language: C++

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

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

#include<bits/stdc++.h>
using namespace std;
int c[100];
int d[100];
int e[100];
int fun(int n)
{
	int t=sqrt(n);
	for(int i=2;i<=sqrt(n);i++)
		if(n%i==0)
			return 0;
	return 1;
}
int main()
{
	int a,b,n,t=0;
	scanf("%d %d %d",&a,&b,&n);
	int j=0;
	int t1=0,t2=0;
	for(int i=1;i<200;i++)
	{
		if(a%i==0&&IsPrime(i))
		{
			c[j++]=i;
			t1++;
		}
	}
	j=0;
	for(int i=1;i<200;i++)
	{
		if(b%i==0&&IsPrime(i))
		{
			d[j++]=i;
			t2++;
			printf("%d\n",i);
		}
	}
	int l=0;
	for(int i=0;i<t1;i++)
	{
		for(int k=0;k<t2;k++)
		{
			printf("%d %d\n",c[i],d[j]);
			if(c[i]==d[k]&&(c[i]!=0||d[k]!=0))
			{
				e[l++]=c[i];
			}
		}
	}
	if(n>l)
		n=l;
	printf("%d",e[n-1]);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:28: error: 'IsPrime' was not declared in this scope
   22 |                 if(a%i==0&&IsPrime(i))
      |                            ^~~~~~~
a.cc:31:28: error: 'IsPrime' was not declared in this scope
   31 |                 if(b%i==0&&IsPrime(i))
      |                            ^~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int c[100];
int d[100];
int e[100];
fun(int n)
{
	int t=sqrt(n);
	for(int i=2;i<=sqrt(n);i++)
		if(n%i==0)
			return 0;
	return 1;
}
int main()
{
	int a,b,n,t=0;
	scanf("%d %d %d",&a,&b,&n);
	int j=0;
	int t1=0,t2=0;
	for(int i=1;i<200;i++)
	{
		if(a%i==0&&IsPrime(i))
		{
			c[j++]=i;
			t1++;
		}
	}
	j=0;
	for(int i=1;i<200;i++)
	{
		if(b%i==0&&IsPrime(i))
		{
			d[j++]=i;
			t2++;
			printf("%d\n",i);
		}
	}
	int l=0;
	for(int i=0;i<t1;i++)
	{
		for(int k=0;k<t2;k++)
		{
			printf("%d %d\n",c[i],d[j]);
			if(c[i]==d[k]&&(c[i]!=0||d[k]!=0))
			{
				e[l++]=c[i];
			}
		}
	}
	if(n>l)
		n=l;
	printf("%d",e[n-1]);
	return 0;
}

Compiler output:
a.cc:6:1: error: ISO C++ forbids declaration of 'fun' with no type [-fpermissive]
    6 | fun(int n)
      | ^~~
a.cc: In function 'int main()':
a.cc:22:28: error: 'IsPrime' was not declared in this scope
   22 |                 if(a%i==0&&IsPrime(i))
      |                            ^~~~~~~
a.cc:31:28: error: 'IsPrime' was not declared in this scope
   31 |                 if(b%i==0&&IsPrime(i))
      |                            ^~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int c[100];
int d[100];
int e[100];
IsPrime(int n)
{
	int t=sqrt(n);
	for(int i=2;i<=sqrt(n);i++)
		if(n%i==0)
			return 0;
	return 1;
}
int main()
{
	int a,b,n,t=0;
	scanf("%d %d %d",&a,&b,&n);
	int j=0;
	int t1=0,t2=0;
	for(int i=1;i<200;i++)
	{
		if(a%i==0&&IsPrime(i))
		{
			c[j++]=i;
			t1++;
		}
	}
	j=0;
	for(int i=1;i<200;i++)
	{
		if(b%i==0&&IsPrime(i))
		{
			d[j++]=i;
			t2++;
			printf("%d\n",i);
		}
	}
	int l=0;
	for(int i=0;i<t1;i++)
	{
		for(int k=0;k<t2;k++)
		{
			printf("%d %d\n",c[i],d[j]);
			if(c[i]==d[k]&&(c[i]!=0||d[k]!=0))
			{
				e[l++]=c[i];
			}
		}
	}
	if(n>l)
		n=l;
	printf("%d",e[n-1]);
	return 0;
}

Compiler output:
a.cc:6:1: error: ISO C++ forbids declaration of 'IsPrime' with no type [-fpermissive]
    6 | IsPrime(int n)
      | ^~~~~~~
Language: C++

#include <stdio.h>
int main()
{
	int a,b,k,count=0;
	scanf("%d%d%d", &a, &b, &k);
	for(int i = 1;count < k;i++)
	{
		if(i / a == 0&&i / b == 0)
		count++;
	}
	printf("%d",i);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:21: error: 'i' was not declared in this scope
   11 |         printf("%d",i);
      |                     ^
Language: Java

mport 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 n = sc.nextInt();

        int[] l = new int[100];
        
        int cnt= 0;
        if(A<B){
            for(int i=1;i<=A;i++){
                if((A%i==0)&&(B%i==0)){
                    l[cnt++]=i;
                    }else{
                        continue;
                    }
                }
                System.out.println(l[cnt-n]);
            }
        if(B<A){
            for(int j=1;j<=B;j++){
                if((A%j==0)&&(B%j==0)){
                    l[cnt++]=j;
                }else{
                    continue;
                }
                }
            }
            System.out.println(l[cnt-n]);
        }
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.util.*;
^
1 error
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:36: error: expected ')' before '{' token
    7 |         for(int i=min(a,b);i>=1;i--{
      |            ~                       ^
      |                                    )
Language: C++

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

int main() {

	int A, B, K;
	cin >> A >> B >> K;
	
	int cnt = 0; // 今まで見つかった数
	for (int i = min(A, B); i >= 1; i--)
	{
		// A % i  →　Aをiで割った余り
		// if(A && B) → AもBも条件を満たすとき
		if (A % i == 0 && B % i == 0) {
			cnt++;	//cntを1増やす。
			if (cnt == K) {	//もし割切れる数が見つかったのがK番目だったら
				cout << i << endl;
				return;
			}
		}
	}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:33: error: return-statement with no value, in function returning 'int' [-fpermissive]
   21 |                                 return;
      |                                 ^~~~~~
Language: C++

#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string>
#include<algorithm>
#include<vector> 
#include<limits>
#include<numeric>
#include<type_traits>
#include<math.h>
using namespace std;
typedef long long ll;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i = (int)(a); i < (int)(b); i++)
#define in(x) cin >> x
#define out(str) cout << str << endl

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int A,B,K,temp;


int main(){
    cin>>A>>B>>K;
    temp=min(A,B)+1;
    while(K){
        temp--;
        if(A%temp==0&&B%temp==0){
            K--;
        }
    }
    out(tmep);
}



Compiler output:
a.cc: In function 'int main()':
a.cc:34:9: error: 'tmep' was not declared in this scope; did you mean 'temp'?
   34 |     out(tmep);
      |         ^~~~
a.cc:17:26: note: in definition of macro 'out'
   17 | #define out(str) cout << str << endl
      |                          ^~~
Language: C++

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

int main() {

	int A, B, K;
	cin >> A >> B >> K;
	
	int cnt = 0; // 今まで見つかった数
	for (int i = 100; i >= 1; i--)
	{
		// A % i  →　Aをiで割った余り
		// if(A && B) → AもBも条件を満たすとき
		if (A % i == 0 && B % i == 0) {
			cnt++;	//cntを1増やす。
			if (cnt == K) {	//もし割切れる数が見つかったのがK番目だったら
				cout << i << endl;
				return;
			}
		}
	}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:33: error: return-statement with no value, in function returning 'int' [-fpermissive]
   20 |                                 return;
      |                                 ^~~~~~
Language: C

#include<stdio.h>
main(){
  int A,B,K,J;
  scanf("%d %d %d",&A,&B,K);
  J=A/K;
  
  

Compiler output:
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main(){
      | ^~~~
main.c: In function 'main':
main.c:5:3: error: expected declaration or statement at end of input
    5 |   J=A/K;
      |   ^
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args)
	{
		//変数
		int count=0;
		boolean sw=false;
		boolean sw2=false;
		boolean sw3=false;
		int answer=0;
		//String answer="Heisei";
		//List<Integer> h=new ArrayList<Integer>();
		//int t[]=new int[(int)Math.pow(10,5)];
		int max=Integer.MIN_VALUE;
		int min=Integer.MAX_VALUE;
		int x=1;
		int y=2;
		//入力
		Scanner sc = new Scanner(System.in);
		int A=sc.nextInt();
		int B=sc.nextInt();
		int K=sc.nextInt();
		//X=sc.nextDouble();
		//int A[]=new int[N];
		//List<Integer> l=new ArrayList<Integer>();
		//List<Integer> w=new ArrayList<Integer>();
		//for(int i=0;i<N;i++)
		//{
		//	l.add(sc.nextInt());
		//}
		//String S=sc.next();
		
		//処理
		while(sw==false)
		{
			//System.out.println("count"+x);
			if(A%x==0 && B%x==0)
			{
				count++;
				if(count==K)
				{
					answer=x;
					sw=true;
				}
				System.out.println(x);
			}else
			{
				sw3==false;
				int n=x;
				y=2;
				List<Integer> l=new ArrayList<Integer>();
				while(n!=1)
				{
					if(n%y==0)
					{
						n=n/y;
						l.add(y);
					}else
					{
						y++;
					}
				}
				//System.out.println(Arrays.toString(l.toArray()));
				for(int j=0;j<l.size();j++)
				{
					if(l.get(j)!=2 || l.get(j)!=5)
					{
						sw3=true;
					}
				}
				
				if(sw3==false)
				{
					count++;
					if(count==K)
					{
						answer=x;
						sw=true;
					}
				}
			}
			x++;
		}
		// 出力
		//System.out.println(Arrays.toString(X));
		//System.out.println(Arrays.deepToString(a));
		//System.out.println(Arrays.toString(A.toArray()));
		System.out.println(answer);
	}
}

Compiler output:
Main.java:48: error: not a statement
				sw3==false;
				   ^
1 error
Language: C++

#include<iostream>

using namespace std;

 int A,B,K;

 int main(){

  cin >> A >> B >> K;

  if (K==1) cout << "1" << endl;
  
  if ((K==2) && (A%2==0) && (B%2==0))
   A = A/2 ; B = B/2 ; cout << "2" << endl;

  cout << A << ", " << B << endl;
 

  if ((K==3) && (A%2==0) && (B%2==0))
  A = A/2 ; B = B/2 ; cout << 2 << endl;

  cout << A << ", " << B << endl;
  

  if ((K==3) && (A%3==0) && (B%3==0))  
  A = A/3 ; B = B/3 ; cout << 3 << endl;
  cout << A << ", " << B << endl;


  if ((K==3) && (A%4==0) && (B%4==0))
  A = A/4 ; B = B/4 ; cout << 4 << endl;

  cout << A << ", " << B << endl;


  else cout << "x" << endl;




 return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:36:3: error: 'else' without a previous 'if'
   36 |   else cout << "x" << endl;
      |   ^~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
  int A,B,K;
  cin >> A >> B >> K;
  int i,c=0;
  for(i=1;i<101;i++){
  if(A%i==0&&B%i==0) c++;
    if(c=K) cout << i << endl;
}


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

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

int main()
{
	int a = 0, b = 0, k = 0;
	vector<int> res;
	cin >> a >> b >> k;
	for (int i = 1; i <= a; i++)
	{
		//cout << fmod(a, i) << endl;
		if ( fmod(a,i)== 0 && fmod(b,i) == 0)
		{
			res.push_back(i);
		}
	}
	cout << res[k-1] << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:22: error: 'fmod' was not declared in this scope
   15 |                 if ( fmod(a,i)== 0 && fmod(b,i) == 0)
      |                      ^~~~
Language: C++

#include<bits/stdc++.h>//atcoder.120.b
using namespace std;
int main (){
	int n,m,mm,nm,k,i,a,s=0;
	cin>>n>>m>>k;
	mm=m;
	nm=n;
	a=m%n;
	while(a!=0){
		m=n;
		n=r;
		a=m%n;
	}
	while(s<=k){
		if(nm%n==0&&mm%n==0){
			i=n;
			s++;
		}
		n--;
	}
	cout<<i;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: 'r' was not declared in this scope
   11 |                 n=r;
      |                   ^
Language: C++

#include<bits/stdc++.h
using namespace std;
int main()
{
  	int n,m,k,i,j=0;
  	scanf("%d%d%d",&n,&m,&k);
  	for(i=1;i<=max(n,m);i++)
    {
      	if(n%i==0&&m%i==0)
        {
          	j++;
          	if(j==k)
            {
              	printf("%d",i);
              	return 0;
            }
        }
    }
  	return 0;
}

Compiler output:
a.cc:1:23: error: missing terminating > character
    1 | #include<bits/stdc++.h
      |                       ^
Language: Java

import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a,b,k,r,num;
    a = sc.nextInt();
    b = sc.nextInt();
    k = sc.nextInt();
    if(a==1&&b==1)
      System.out.println(1);
    if(a<b){
      num = a;
      a = b;
      b = num;
    }
    r = a%b;
    while(r!=0){
      a = b;
      b = r;
      r = a%b;
    }
    if(k=1)
      System.out.println(b);
    int x = 0,j = 1;
    for(int i=2;i<=b;i++){
      int c;
      c = b%i;
      if(c==0){
        j++;
        x = i;
        if(j==k){
          System.out.println(b/x);
          break;
        }
      }
    }
  }
}


Compiler output:
Main.java:23: error: incompatible types: int cannot be converted to boolean
    if(k=1)
        ^
1 error
Language: C++

#include<bits/stdc++.h
using namespace std;
int main()
{
  	int n,m,k,i,j=0;;
  	scanf("%d%d%d",&n,&m,&k);
  	for(i=1;i<=n;i++)
    {
      	if(n%i==0&&m%i==0)
        {
          	j++;
          	if(j==k)
            {
              	printf("%d",i);
              	return 0;
            }
        }
    }
  	return 0;
}

Compiler output:
a.cc:1:23: error: missing terminating > character
    1 | #include<bits/stdc++.h
      |                       ^
Language: C

#include <stdio.h>

int main(void){
    int a, b, k, i;
    int value[256];
    scanf("%d %d %d", &a, &b, &k);
    
    int c=a;
    if(a>b){
        c=b;
    }
    
    for(i=1;i<=c;i++){
        if(a%i==0&&b%i==0){
            value[i] = i;
            printf("%d\n",value[i]);//公約数を出力
                
            }
        }
    }
    
    int k_benme, max, l;
    int a2[256];
    while(l<=c){
        max = k_benme =a2[0];
        l = 0;
        do{
            if ( max < a2[l] ){
                k_benme = max;
                max = a2[l];
                
            } l++;
        }
    }
    printf("%d\n", k_benme);
        
    return 0;
    }

Compiler output:
main.c:24:5: error: expected identifier or '(' before 'while'
   24 |     while(l<=c){
      |     ^~~~~
main.c:35:12: error: expected declaration specifiers or '...' before string constant
   35 |     printf("%d\n", k_benme);
      |            ^~~~~~
main.c:35:20: error: expected declaration specifiers or '...' before 'k_benme'
   35 |     printf("%d\n", k_benme);
      |                    ^~~~~~~
main.c:37:5: error: expected identifier or '(' before 'return'
   37 |     return 0;
      |     ^~~~~~
main.c:38:5: error: expected identifier or '(' before '}' token
   38 |     }
      |     ^
Language: C++

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

int main() {

  double A, B, K;
  int c = 0;
  cin >> A >> B >> K;
  
  
  for (double i = 1; ; i++) {

    if (A%i==0 && B%i==0) {
      c += 1;
    }
    else{
      double p, q;
      p = A%i;
        q = B%i;
        for(int j=0; ; j++){
        p= (p*10)%i;
          if(p==0){
          break;
          }
        }
          for(int j=0 ; ; j++){
        q= (q*10)%i;
          if(q==0){
          break;
          }
        }
          if(p==0 && q==0){
          c +=1;
          }
    }
    
    if ( c == K ){
	  cout << i << endl;
      break;
    }

    
  }

  
}




Compiler output:
a.cc: In function 'int main()':
a.cc:13:10: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   13 |     if (A%i==0 && B%i==0) {
      |         ~^~
      |         | |
      |         | double
      |         double
a.cc:13:20: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   13 |     if (A%i==0 && B%i==0) {
      |                   ~^~
      |                   | |
      |                   | double
      |                   double
a.cc:18:12: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   18 |       p = A%i;
      |           ~^~
      |           | |
      |           | double
      |           double
a.cc:19:14: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   19 |         q = B%i;
      |             ~^~
      |             | |
      |             | double
      |             double
a.cc:21:18: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   21 |         p= (p*10)%i;
      |            ~~~~~~^~
      |              |    |
      |              |    double
      |              double
a.cc:27:18: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   27 |         q= (q*10)%i;
      |            ~~~~~~^~
      |              |    |
      |              |    double
      |              double
Language: C++

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

int main() {

  int A, B, K;
  int c = 0;
  cin >> A >> B >> K;
  
  
  for (double i = 1; ; i++) {

    if (A%i==0 && B%i==0) {
      c += 1;
    }
    else{
      double p, q;
      p = A%i;
        q = B%i;
        for(int j=0; ; j++){
        p= (p*10)%i;
          if(p==0){
          break;
          }
        }
          for(int j=0 ; ; j++){
        q= (q*10)%i;
          if(q==0){
          break;
          }
        }
          if(p==0 && q==0){
          c +=1;
          }
    }
    
    if ( c == K ){
	  cout << i << endl;
      break;
    }

    
  }

  
}




Compiler output:
a.cc: In function 'int main()':
a.cc:13:10: error: invalid operands of types 'int' and 'double' to binary 'operator%'
   13 |     if (A%i==0 && B%i==0) {
      |         ~^~
      |         | |
      |         | double
      |         int
a.cc:13:20: error: invalid operands of types 'int' and 'double' to binary 'operator%'
   13 |     if (A%i==0 && B%i==0) {
      |                   ~^~
      |                   | |
      |                   | double
      |                   int
a.cc:18:12: error: invalid operands of types 'int' and 'double' to binary 'operator%'
   18 |       p = A%i;
      |           ~^~
      |           | |
      |           | double
      |           int
a.cc:19:14: error: invalid operands of types 'int' and 'double' to binary 'operator%'
   19 |         q = B%i;
      |             ~^~
      |             | |
      |             | double
      |             int
a.cc:21:18: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   21 |         p= (p*10)%i;
      |            ~~~~~~^~
      |              |    |
      |              |    double
      |              double
a.cc:27:18: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   27 |         q= (q*10)%i;
      |            ~~~~~~^~
      |              |    |
      |              |    double
      |              double
Language: Java

import java.util.Scanner;

public class Main1 {
	public static void main(String[] args){
		Scanner s = new Scanner(System.in);
		int a=s.nextInt();
		int b=s.nextInt();
		int k=s.nextInt();
		s.close();
		int num=0;
		int count=0;
		while(count<k){
			num++;
			if((a%num==0)&&(b%num==0)){
				count++;
			}
		}
		System.out.println(num);
	}
}

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

#include<iostream>
using namespace std;
int main(){
  int A,B,K;
  cin >> A >> B >> K;
  int i,c=0;
  if(A%i=0&&B%i=0){
    c++:
    if(c=K){
      cout << i << endl;
    }
  }
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:7:11: error: lvalue required as left operand of assignment
    7 |   if(A%i=0&&B%i=0){
      |          ~^~~~~
a.cc:8:8: error: expected ';' before ':' token
    8 |     c++:
      |        ^
      |        ;
Language: C

#include<iostream>
#include<vector>
#include <algorithm>
#include <functional>
using namespace std;
int main(){
    int a,b,k,r;
    cin >> a >> b >> k;
    swap(a,b);
    while ((r=a%b)) {
    a = b;
    b = r;
    }
    vector<int> ans;
    for(int i=1;i<b+1;i++){
        if(b%i==0)
        ans.push_back(i);
    }
    sort(ans.begin(),ans.end(),greater<int>());
    cout << ans[k-1] <<endl;
    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, K;
  int c = 0;
  cin >> A >> B >> K;
  
  
  for (int i = 1; ; i++) {

    if (A%i==0 && B%i==0) {
      c += 1;
    }
    else{
      double p, q;
      p = A%i
        q = B%i
        for(int j=0;; j++){
        p= (p*10)%i
          if(p==0){
          break;
          }
        }
          for(int j=0;; j++){
        q= (q*10)%i
          if(q==0){
          break;
          }
        }
          if(p==0 && q==0){
          c +=1;
          }
    }
    
    if ( c == K ){
	  cout << i << endl;
      break;
    }

    
  }

  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:14: error: expected ';' before 'q'
   18 |       p = A%i
      |              ^
      |              ;
   19 |         q = B%i
      |         ~     
a.cc:20:23: error: 'j' was not declared in this scope
   20 |         for(int j=0;; j++){
      |                       ^
a.cc:27:18: error: invalid operands of types 'double' and 'int' to binary 'operator%'
   27 |         q= (q*10)%i
      |            ~~~~~~^~
      |              |    |
      |              |    int
      |              double
Language: C++

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

int main() {

  int A, B, K;
  int c = 0;
  cin >> A >> B >> K;
  
  
  for (int i = 1; ; i++) {

    if (A%i==0 && B%i==0) {
      c += 1;
    }
    else{
      double p, q;
      p = A%i
        q = B%i
        for(int j=0;; j++){
        p= (p*10)%i
          if(p==0){
          break;
          }
          for(int j=0;; j++){
        q= (q*10)%i
          if(q==0){
          break;
          }
        }
          if(p==0 && q==0){
          c +=1;
          }
    }
    
    if ( c == K ){
	  cout << i << endl;
      break;
    }

    
  }

  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:14: error: expected ';' before 'q'
   18 |       p = A%i
      |              ^
      |              ;
   19 |         q = B%i
      |         ~     
a.cc:20:23: error: 'j' was not declared in this scope
   20 |         for(int j=0;; j++){
      |                       ^
a.cc:45:2: error: expected '}' at end of input
   45 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <iostream>
#include <mnath.h>

int main(void){
	int A, B, K, count = 0;
	std::cin >> A >> B >> K;
	int start = max(A, B);
	for(int i = start; count < K; i--){
		if((A % i == 0) && (B % i == 0)){
			count++;
		}
	}
	cout << i;
	
	return 0;
}

Compiler output:
a.cc:2:10: fatal error: mnath.h: No such file or directory
    2 | #include <mnath.h>
      |          ^~~~~~~~~
compilation terminated.