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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: invalid operands of types 'double' and 'int' to binary 'operator%'
   10 |         if(A%i==0 & B%i==0){
      |            ~^~
      |            | |
      |            | int
      |            double
a.cc:10:22: error: invalid operands of types 'double' and 'int' to binary 'operator%'
   10 |         if(A%i==0 & B%i==0){
      |                     ~^~
      |                     | |
      |                     | int
      |                     double
Language: C++

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

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

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



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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:15:12: error: 'k' was not declared in this scope
   15 |    cout<<C[k-1]<<endl;
      |            ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: conflicting declaration 'std::vector<int> A'
    7 |    vector<int> A(c);
      |                ^
a.cc:4:8: note: previous declaration as 'int A'
    4 |    int A,B,K,c;
      |        ^
a.cc:11:12: error: request for member 'push_back' in 'A', which is of non-class type 'int'
   11 |          A.push_back(j);
      |            ^~~~~~~~~
a.cc:15:10: error: 'v' was not declared in this scope
   15 |    cout<<v[k-1]<<endl;
      |          ^
a.cc:15:12: error: 'k' was not declared in this scope
   15 |    cout<<v[k-1]<<endl;
      |            ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:15: error: conflicting declaration 'std::vector<int> A'
    8 |   vector<int> A(a);
      |               ^
a.cc:4:5: note: previous declaration as 'int A'
    4 | int A,B,K,a;
      |     ^
a.cc:11:9: error: invalid types 'int[int]' for array subscript
   11 |   cin>>A[i];
      |         ^
a.cc:14:12: error: invalid types 'int[int]' for array subscript
   14 |     cout<<A[i]<<endl;
      |            ^
Language: C++

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

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

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
const ll MOD=1000000007;
const double PI=3.14159265358979;
const ll INF= pow(10,18);
typedef pair<ll,ll> P;
typedef vector<ll> vl;
typedef vector<vl> vvl;
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,n) FOR(i,0,n)
string abc="abcdefghijklmnopqrstuvwxyz";
string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";


int main() {
  ll a,b,k;
  cin >> a >> b >> k;
  ll cnt=0,i=1
  while(cnt!=k&&i<=max(a,b)){
    if(a%i==0&&b%i==0){
      cnt++;
    }
    i++;
  }
  cout << i << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:3: error: expected ',' or ';' before 'while'
   20 |   while(cnt!=k&&i<=max(a,b)){
      |   ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
const ll MOD=1000000007;
const double PI=3.14159265358979;
const ll INF= pow(10,18);
typedef pair<ll,ll> P;
typedef vector<ll> vl;
typedef vector<vl> vvl;
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,n) FOR(i,0,n)
string abc="abcdefghijklmnopqrstuvwxyz";
string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";

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

int main() {
  ll a,b,k;
  cin >> a >> b >> k;
  cout << a/gcd(a,b)*b*k << endl;
}

Compiler output:
a.cc:15:8: error: 'a' was not declared in this scope
   15 | ll gcd(a,b){
      |        ^
a.cc:15:10: error: 'b' was not declared in this scope
   15 | ll gcd(a,b){
      |          ^
a.cc:15:11: error: expression list treated as compound expression in initializer [-fpermissive]
   15 | ll gcd(a,b){
      |           ^
a.cc: In function 'int main()':
a.cc:27:13: error: reference to 'gcd' is ambiguous
   27 |   cout << a/gcd(a,b)*b*k << endl;
      |             ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:58,
                 from a.cc:1:
/usr/include/c++/14/numeric:173:5: note: candidates are: 'template<class _Mn, class _Nn> constexpr std::common_type_t<_Mn, _Nn> std::gcd(_Mn, _Nn)'
  173 |     gcd(_Mn __m, _Nn __n) noexcept
      |     ^~~
a.cc:15:4: note:                 'll gcd'
   15 | ll gcd(a,b){
      |    ^~~
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=1; ;i++){
  if(A%i==0 && B%i==0)
    sum++;
    if(sum==K) break;
  }cout<<i<<endl;
   return 0;
}

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

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

int main(){
  int a,b,k;
  cin >> a >> b >>k;
  int cnt=0;
  for(int i=1;i<min(a,b)+1;i++){
    double da = (double)a,db = (double)b,di = (double)i;
    if((da % di) == 0.0 && (db % di) == 0.0){
      cnt++;
      if(cnt == k){
        cout << i << endl;
        return  0;
      }
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:12: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   10 |     if((da % di) == 0.0 && (db % di) == 0.0){
      |         ~~ ^ ~~
      |         |    |
      |         |    double
      |         double
a.cc:10:32: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   10 |     if((da % di) == 0.0 && (db % di) == 0.0){
      |                             ~~ ^ ~~
      |                             |    |
      |                             |    double
      |                             double
Language: C++

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

int main(){
  int a,b,k;
  cin >> a >> b >>k;
  int cnt=0;
  for(int i=1;i<min(a,b)+1;i++){
    double da = (double)a,db = (double)b,di = (double)i;
    if((da%di) == 0.0 && (db%di) == 0.0){
      cnt++;
      if(cnt == k){
        cout << i << endl;
        return  0;
      }
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:11: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   10 |     if((da%di) == 0.0 && (db%di) == 0.0){
      |         ~~^~~
      |         |  |
      |         |  double
      |         double
a.cc:10:29: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   10 |     if((da%di) == 0.0 && (db%di) == 0.0){
      |                           ~~^~~
      |                           |  |
      |                           |  double
      |                           double
Language: C++

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

int main(){
  int a,b,k;
  cin >> a >> b >>k;
  int cnt=0;
  for(int i=1;i<min(a,b)+1;i++){
    double da = (double)a,db = (double)b,di = (double)i
    if((da%di) == 0.0 && (db%di) == 0.0){
      cnt++;
      if(cnt == k){
        cout << i << endl;
        return  0;
      }
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: expected ',' or ';' before 'if'
   10 |     if((da%di) == 0.0 && (db%di) == 0.0){
      |     ^~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:9:14: error: expected primary-expression before 'double'
    9 |     if((a%i)(double) == 0.0 && (b%i)(double) == 0.0){
      |              ^~~~~~
a.cc:9:20: error: expression cannot be used as a function
    9 |     if((a%i)(double) == 0.0 && (b%i)(double) == 0.0){
      |                    ^
a.cc:9:38: error: expected primary-expression before 'double'
    9 |     if((a%i)(double) == 0.0 && (b%i)(double) == 0.0){
      |                                      ^~~~~~
a.cc:9:44: error: expression cannot be used as a function
    9 |     if((a%i)(double) == 0.0 && (b%i)(double) == 0.0){
      |                                            ^
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:9:10: error: expected primary-expression before 'double'
    9 |     if(a(double)%i == 0.0 && b(double)%i == 0.0){
      |          ^~~~~~
a.cc:9:16: error: 'a' cannot be used as a function
    9 |     if(a(double)%i == 0.0 && b(double)%i == 0.0){
      |                ^
a.cc:9:32: error: expected primary-expression before 'double'
    9 |     if(a(double)%i == 0.0 && b(double)%i == 0.0){
      |                                ^~~~~~
a.cc:9:38: error: 'b' cannot be used as a function
    9 |     if(a(double)%i == 0.0 && b(double)%i == 0.0){
      |                                      ^
Language: C++

a,b,k = map(int, input().split())
c = 0
for i in range(100,0,-1):
    if a%i==0 and b%i==0:
        c += 1
        if c == k:
            print(i)
            exit()

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

import math
from functools import reduce
import itertools

def cf(x1,x2):
    cf=[1]
    for i in range(2,min(x1,x2)+1):
        if x1 % i == 0 and x2 % i == 0:
            cf.append(i)
    return cf

def solve():
    a, b, k = map(int, input().split())
    print(cf(a, b)[-k])
    return 0

if __name__ == "__main__":
    solve()

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

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


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

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;

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

    // 今まで見つかった数
    int cnt = 0;

    for (int i = 0; i >= 1; --i)
    {
        // A % i は、Aをiで割った余り
        // if(A && B) は、AもBも条件を満たす時
        if (a % i == 0 && b % i == 0)
        {
            // cnt を1増やす
            cnt++;
            // もし割り切れる数が見つかったのが、K番目だったら
            if (cnt == k)
            {
                cout << i << endl;
                return;
            }
        }
    }
}

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

import java.util.*;
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();
      
		ArrayList<Integer> al = new ArrayList<>();
		al.add(1);
      	int min = A;
      	if(A>B){
          min = B;
        }
      	for(int i = 1; i < min+1; i++){
          	if((A%i==0)&&(B%i==0)){
              al.add(i);
            }
        }
		System.out.println(al.get(al.length()-K+1));
	}
}


Compiler output:
Main.java:20: error: cannot find symbol
		System.out.println(al.get(al.length()-K+1));
		                            ^
  symbol:   method length()
  location: variable al of type ArrayList<Integer>
1 error
Language: Java

import java.util.*;
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();
      
		ArrayList<Integer> al = new ArrayList<>();

      	int min = A;
      	if(A>B){
          min = B;
        }
      	for(int i = 1; i < min+1; i++){
          	if((A%i==0)&&(B%i==0)){
              al.add(i);
            }
        }
		System.out.println(al.get(al.length()-K+1));
	}
}


Compiler output:
Main.java:20: error: cannot find symbol
		System.out.println(al.get(al.length()-K+1));
		                            ^
  symbol:   method length()
  location: variable al of type ArrayList<Integer>
1 error
Language: C++

clude <bits/stdc++.h>
using namespace std;
 
int main() {
int A,B,K;
  cin>>A>>B>>K;
     vector<int> C(100);
  
for (int i = 0; i < 100; i++) {
 if(A%i==0 && B%i==0){
   C[i]=i;
 }
}
sort(C.begin(), C.end());
reverse(C.begin(), C.end());
  cout<<C[K]<<endl;
}

Compiler output:
a.cc:1:1: error: 'clude' does not name a type
    1 | clude <bits/stdc++.h>
      | ^~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin>>A>>B>>K;
      |   ^~~
a.cc:7:6: error: 'vector' was not declared in this scope
    7 |      vector<int> C(100);
      |      ^~~~~~
a.cc:7:13: error: expected primary-expression before 'int'
    7 |      vector<int> C(100);
      |             ^~~
a.cc:11:4: error: 'C' was not declared in this scope
   11 |    C[i]=i;
      |    ^
a.cc:14:6: error: 'C' was not declared in this scope
   14 | sort(C.begin(), C.end());
      |      ^
a.cc:14:1: error: 'sort' was not declared in this scope; did you mean 'short'?
   14 | sort(C.begin(), C.end());
      | ^~~~
      | short
a.cc:15:1: error: 'reverse' was not declared in this scope
   15 | reverse(C.begin(), C.end());
      | ^~~~~~~
a.cc:16:3: error: 'cout' was not declared in this scope
   16 |   cout<<C[K]<<endl;
      |   ^~~~
a.cc:16:15: error: 'endl' was not declared in this scope
   16 |   cout<<C[K]<<endl;
      |               ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
int A,B,K;
  cin>>A>>B>>K;
     vector<int> C(N);
  
for (int i = 0; i < N; i++) {
 if(A%i==0 && B%i==0){
   C[i]=i;
 }
}
sort(C.begin(), C.end());
reverse(C.begin(), C.end());
  cout<<C[K]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:20: error: 'N' was not declared in this scope
    7 |      vector<int> C(N);
      |                    ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
int A,B,K;
  cin>>A>>B>>K;
     vector<int> C(N);
  
for (int i = 0; i < N; i++) {
 if(A%i==0 $$ B%i==0){
   C[i]=i
 }
}
sort(C.begin(), C.end());
reverse(C.begin(), C.end());
  cout<<C[K]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:20: error: 'N' was not declared in this scope
    7 |      vector<int> C(N);
      |                    ^
a.cc:10:11: error: expected ')' before '$$'
   10 |  if(A%i==0 $$ B%i==0){
      |    ~      ^~~
      |           )
a.cc:11:10: error: expected ';' before '}' token
   11 |    C[i]=i
      |          ^
      |          ;
   12 |  }
      |  ~
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 cnt = 0;
      int ans = -1;
      for(int i = 0; i <= 100; i++){
      	if ( a % i == 0 && b % i == 0)
          cnt++;
          if (cnt == k)
            ans = i;
      }
      System.out.println(ans);
    }	
}


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: Java

public class Main{
	public static void main(String args[]){
      int a = sc.nextInt();
      int b = sc.nextInt();
      int k = sc.nextInt();
      int cnt = 0;
      int ans = -1;
      for(int i = 0; i <= 100; i++){
      	if ( a % i == 0 && b % i == 0)
          cnt++;
          if (cnt == k)
            ans = i;
      }
      System.out.println(ans);
    }	
}

Compiler output:
Main.java:3: error: cannot find symbol
      int a = sc.nextInt();
              ^
  symbol:   variable sc
  location: class Main
Main.java:4: error: cannot find symbol
      int b = sc.nextInt();
              ^
  symbol:   variable sc
  location: class Main
Main.java:5: error: cannot find symbol
      int k = sc.nextInt();
              ^
  symbol:   variable sc
  location: class Main
3 errors
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;
}
}
}
assert ( false );
}


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

#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
 
using namespace std;
 
int main(){
    int A,B,K;
    cin>>A>>B>>K;
    int count = 0;
    int ans;
    for(int i = 1;!(count=K);i++){
        if(A%i==0&&B%i==0){
            count++;
            cout=ans;
        }
    }
    cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:18: error: no match for 'operator=' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int')
   17 |             cout=ans;
      |                  ^~~
In file included from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/ostream:458:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator=(std::basic_ostream<_CharT, _Traits>&&) [with _CharT = char; _Traits = std::char_traits<char>]'
  458 |       operator=(basic_ostream&& __rhs)
      |       ^~~~~~~~
/usr/include/c++/14/ostream:458:33: note:   no known conversion for argument 1 from 'int' to 'std::basic_ostream<char>&&'
  458 |       operator=(basic_ostream&& __rhs)
      |                 ~~~~~~~~~~~~~~~~^~~~~
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;
    for(int i = 1; i<=Math.mx(A,B); i++){
      if(A%i == 0 && B%i==0){
        cnt++;
        if(cnt == K){
          System.out.println(i);
          break;
        }
      }
    }
  }
}

Compiler output:
Main.java:9: error: cannot find symbol
    for(int i = 1; i<=Math.mx(A,B); i++){
                          ^
  symbol:   method mx(int,int)
  location: class Math
1 error
Language: C++

#include <bits/stdc++.h>
#define INF 2e9
using namespace std;
typedef long long llong;
typedef long double ldouble;

using Graph = vector<vector<int>>;

int ctoi(const char c){
  if('0' <= c && c <= '9') return (c-'0');
  return -1;
}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:19:15: error: expected primary-expression before '%' token
   19 |     if(A%i==0%%B%i==0) ++flg;
      |               ^
Language: C++

#include <bits/stdc++.h>
#define INF 2e9
using namespace std;
typedef long long llong;
typedef long double ldouble;

using Graph = vector<vector<int>>;

int ctoi(const char c){
  if('0' <= c && c <= '9') return (c-'0');
  return -1;
}

int main(){
  int A,B,K;
  cin >> A >> B >> K;
  int flg = 0;
  fpr(int i=1; i<=min(A,B); ++i){
    if(A%i==0%%B%i==0) ++flg;
    if(flg==K){
      cout << i << endl;
      return 0;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:7: error: expected primary-expression before 'int'
   18 |   fpr(int i=1; i<=min(A,B); ++i){
      |       ^~~
a.cc:18:16: error: 'i' was not declared in this scope
   18 |   fpr(int i=1; i<=min(A,B); ++i){
      |                ^
Language: C++

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

int main(){
    int a,b,c;
    const int CO=100;
    vector<int> vb;

    cin>>a>>b>>c;
    for (int i=CO+1;i>=1;i--){
        if (a %i==0 && b % i==0){
        vb.push_back(i);
        }
    }
    cout<<vb[c-1]<<endl;
    }
    return 0;
}

Compiler output:
a.cc:19:5: error: expected unqualified-id before 'return'
   19 |     return 0;
      |     ^~~~~~
a.cc:20:1: error: expected declaration before '}' token
   20 | }
      | ^
Language: Java

import java.util.Scanner;
  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;
      for(int i=1; i<=100; i++){
        if( A%i == 0 && B%i == 0){
          cnt++;
          if(cnt == K){
            System.out.println(i);
            break;
          }
        }
      }
    }



Compiler output:
Main.java:18: error: reached end of file while parsing
    }
     ^
1 error
Language: Java

import java.util.Scanner;
  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 i = 1;
      int cnt = 0;
      while(true){
        if( i%A == 0 && i%B==0){
          cnt++;
          if(cnt==K){
            System.out.println(cnt);
            break;
          }
        }
        i++;
      }
    }
  }
}


Compiler output:
Main.java:22: error: class, interface, enum, or record expected
}
^
1 error
Language: Java

import java.util.Scanner{
  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 i = 1;
      int cnt = 0;
      while(true){
        if( i%A == 0 && i%B==0){
          cnt++;
          if(cnt==K){
            System.out.println(cnt);
            break;
          }
        }
        i++;
      }
    }
  }
}

Compiler output:
Main.java:1: error: ';' expected
import java.util.Scanner{
                        ^
Main.java:22: error: class, interface, enum, or record expected
}
^
2 errors
Language: C++

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

int main() {
    int A, B, K;
    cin >> A >> B >> K;

    int n = min(A, B);
    vector<int> ans;
    for (int i = 1; i <= n; ++i) {
        if (A % i == 0 && B % i == 0) {
            ans.push_back(i);
        }
    }

    sort(ans.begin(), ans.end(), greater<int>());
    cout << ans[K - 1] << 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 'short'?
   17 |     sort(ans.begin(), ans.end(), greater<int>());
      |     ^~~~
      |     short
Language: C++

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

using namespace std;

int main()
{
  int A, B, K;
  cin >> A >> B >> K;

  int min = A < B ? A : B;
  int count = 0;
  for (int i = min; i > 0; --i)
  {
    if (B%i == 0 && A%i == 0) ++count;
    if (count == K)
    {
      cout << i << endl;
      return;
    }
  }
}

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

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

using namespace std;

int main()
{
  int A, B, K;
  cin >> A >> B >> K;

  int min = A < B ? A : B;
  int count = 0;
  cout << sqrt(min) << endl;
  for (int i = min; i > 0; --i)
  {
    if (B%i == 0 && A%i == 0) ++count;
    if (count == K)
    {
      return;
    }
  }
}

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

//的場梨沙★担当
//結城晴★副担当
//日野茜★副担当
#include <vector>
#include <list>
#include <map>
#include <climits>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string.h>
#include <string>
#include <cstring>
#include <ctime>
#include <queue>
#include <random>
#include <cctype>
#include <complex>
#include <regex>
#include <unordered_map>
#include <string>
#include <algorithm>
#include <cctype>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <iomanip>
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <vector>
#include <stdio.h>


using namespace std;

int main(void) {
    int A,B,K;
    cin>>A>>B>>K;
    string S;
    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;

            }
        }
    }
    assert ( false );
}


Compiler output:
a.cc: In function 'int main()':
a.cc:64:5: error: 'assert' was not declared in this scope
   64 |     assert ( false );
      |     ^~~~~~
a.cc:40:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
   39 | #include <iomanip>
  +++ |+#include <cassert>
   40 | #include <iostream>
Language: C++

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

int main(){

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

for(int i=1;ans<=K;++i){
if(A%i==0&&B%i==0){ans++;}}

cout<<i<<endl;


}

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

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

int main(){

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

for(int i=1;ans<=K;i++){
if(A%i==0&&B%i==0){ans++}}


}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:25: error: expected ';' before '}' token
   11 | if(A%i==0&&B%i==0){ans++}}
      |                         ^
      |                         ;
Language: C

#include<stdio.h>
  
int main()
{
　int a,b,k;
 
  scanf("%d%d%d",&a,&b,&k);
 
  int min;
  int ar[1000];
  int t=0;
  
  if(a<=b)
    min=a;
  else
    min=b;
 
  for(int i=1;i<=min;i++){
  　if(a%i==0&&b%i==0){
   　 ar[t]=i;
    　t++;
  　}
　}
  
  printf("%d",ar[t-k]);
 
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:1: error: stray '\343' in program
    5 | <U+3000>int a,b,k;
      | ^~~~~~~~
main.c:19:3: error: stray '\343' in program
   19 |   <U+3000>if(a%i==0&&b%i==0){
      |   ^~~~~~~~
main.c:20:4: error: stray '\343' in program
   20 |    <U+3000> ar[t]=i;
      |    ^~~~~~~~
main.c:21:5: error: stray '\343' in program
   21 |     <U+3000>t++;
      |     ^~~~~~~~
main.c:22:3: error: stray '\343' in program
   22 |   <U+3000>}
      |   ^~~~~~~~
main.c:23:1: error: stray '\343' in program
   23 | <U+3000>}
      | ^~~~~~~~
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:5:1: error: stray '\343' in program
    5 | <U+3000>int a,b,k;
      | ^~~~~~~~
main.c:19:3: error: stray '\343' in program
   19 |   <U+3000>if(a%i==0&&b%i==0){
      |   ^~~~~~~~
main.c:20:4: error: stray '\343' in program
   20 |    <U+3000> ar[t]=i;
      |    ^~~~~~~~
main.c:21:5: error: stray '\343' in program
   21 |     <U+3000>t++;
      |     ^~~~~~~~
main.c:22:3: error: stray '\343' in program
   22 |   <U+3000>}
      |   ^~~~~~~~
main.c:23:1: error: stray '\343' in program
   23 | <U+3000>}
      | ^~~~~~~~
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:22:5: error: stray '\343' in program
   22 |     <U+3000>t++;
      |     ^~~~~~~~
main.c:28:1: error: stray '\343' in program
   28 | <U+3000>return 0;
      | ^~~~~~~~
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:21:5: error: stray '\343' in program
   21 |     <U+3000>j++;
      |     ^~~~~~~~
main.c:27:1: error: stray '\343' in program
   27 | <U+3000>return 0;
      | ^~~~~~~~
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:20:5: error: stray '\343' in program
   20 |     <U+3000>j++;
      |     ^~~~~~~~
main.c:25:1: error: stray '\343' in program
   25 | <U+3000>return 0;
      | ^~~~~~~~
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:19:5: error: stray '\343' in program
   19 |     <U+3000>j++;
      |     ^~~~~~~~
main.c:24:1: error: stray '\343' in program
   24 | <U+3000>return 0;
      | ^~~~~~~~
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:16:16: error: 'num' undeclared (first use in this function)
   16 |   for( i=1; i<=num; ++i ){
      |                ^~~
main.c:16:16: note: each undeclared identifier is reported only once for each function it appears in
main.c:19:5: error: stray '\343' in program
   19 |     <U+3000>j++;
      |     ^~~~~~~~
main.c:24:1: error: stray '\343' in program
   24 | <U+3000>return 0;
      | ^~~~~~~~
Language: C

#include <stdio.h>

int main(void)
{
  int a,b;
  int k;
  int i,j;
  int a[100];
  
  scanf("%d%d%d",&a, &b, &k);

  if(a<b)
	a=b;
    
  for( j=0; j<b; i++)
  	for( i=1; i<=num; ++i ){
    	if( num%i == 0 )
      		int[j]=i;
    }
  }

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:7: error: conflicting types for 'a'; have 'int[100]'
    8 |   int a[100];
      |       ^
main.c:5:7: note: previous declaration of 'a' with type 'int'
    5 |   int a,b;
      |       ^
main.c:16:22: error: 'num' undeclared (first use in this function)
   16 |         for( i=1; i<=num; ++i ){
      |                      ^~~
main.c:16:22: note: each undeclared identifier is reported only once for each function it appears in
main.c:18:17: error: expected expression before 'int'
   18 |                 int[j]=i;
      |                 ^~~
main.c: At top level:
main.c:22:9: error: expected identifier or '(' before 'return'
   22 |         return 0;
      |         ^~~~~~
main.c:23:1: error: expected identifier or '(' before '}' token
   23 | }
      | ^
Language: C++

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

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

      if (cnt == k) {
         cout << i << endl;
         return 0;
      }
   }
   return 0;
}

Compiler output:
a.cc:1:7: error: expected unqualified-id before 'if'
    1 |       if (cnt == k) {
      |       ^~
a.cc:5:4: error: expected declaration before '}' token
    5 |    }
      |    ^
a.cc:6:4: error: expected unqualified-id before 'return'
    6 |    return 0;
      |    ^~~~~~
a.cc:7:1: error: expected declaration before '}' token
    7 | }
      | ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:13:13: error: expected primary-expression before '}' token
   13 |             }
      |             ^
a.cc:12:23: error: expected ';' before '}' token
   12 |                 return
      |                       ^
      |                       ;
   13 |             }
      |             ~
Language: C++

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

int main() {
    int a,b;
    cin >> a >>b;
    int c;
    cin >> c;
    int k=0;
    vector<int> v(100);
    for(int i=min(a,b);i=1;i--)
        if(a%i==0&&b%i==0){
            v.at(k)=i;
            k++;
        }
    }
    cout << v.at(c-1) << endl;
}

Compiler output:
a.cc:17:5: error: 'cout' does not name a type
   17 |     cout << v.at(c-1) << endl;
      |     ^~~~
a.cc:18:1: error: expected declaration before '}' token
   18 | }
      | ^
Language: C++

A,B,K=map(int,input().split())
N=101
ls=[]
LS=[]
for i in range(1,N):
  if A%i==0:
    ls.append(i)
  if B%i==0:
    LS.append(i)
r=set(ls)
R=set(LS)
r=set(r & R)
r=list(r)
r.sort(reverse=True)
print(r[K-1])

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

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

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

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

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

int main() {
  ios_base::sync_with_stdio(false);

  int a, b, k;
  cin >> a >> b >> k;
  vector <int> Div;
  int x = min(a,b), y = max(a,b);
  for (int i = 1; i <= x ; i++)
    if ( x % i == 0 )
      Div.push_back(i);  
  Div.push_back(x);
  for (auto i : Div)
    if (y % i != 0)
      Div.erase(remove(Div.begin(), Div.end(), i), Div.end());
  cout << Div[Div.size() - k] << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:20:39: error: expected '}' at end of input
   20 |   cout << Div[Div.size() - k] << endl;
      |                                       ^
a.cc:6:12: note: to match this '{'
    6 | int main() {
      |            ^
Language: C

#include<stdio.h>
int main()
{
    int a,b,les,k,i,count=0,res[20];
    scanf("%d%d%d",&a,&b,&k);
    if(a>b)
    les=b;
    else
    les=a;
    for(i=1;i<=les;i++)
    {
        if(a%i==0&&b%i==0)
        {
            res[count]=i;
            count++;
            
        }
    }
 
    count=count-k;
    printf("%d",res[count]);
    

Compiler output:
main.c: In function 'main':
main.c:21:5: error: expected declaration or statement at end of input
   21 |     printf("%d",res[count]);
      |     ^~~~~~
Language: C++

#include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
int main(){
  ll a,b,k;
  cin>>a>>b>>k;
  vll d(0);
  for(int i=100;i>=1;i++){
    if(a%i==b%i==0){
      d.pb(i);
  }
  COUT(d[k-1]);
}


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

#include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
int main(){
  ll a,b,k;
  cin>>a>>b>>k;
  vll d(0);
  for(int i=1;i<=100;i++){
    if(a%i==b%i==0){
      d.pb(i);
    }
  }
  COUT(d(k-1));
}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:9: error: no match for call to '(vll {aka std::vector<long long int>}) (long long int)'
   47 |   COUT(d(k-1));
      |        ~^~~~~
a.cc:17:24: note: in definition of macro 'COUT'
   17 | #define COUT(x) cout<<(x)<<endl
      |                        ^
Language: C++

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

int main() {
  int A, B, K;
  cin >> A >> B >> K;
  int tm = min(A, B);
  vector<int> dvs;
  for(int i = 1; i <= tm; ++i) {
    if(A % i == 0 && B % i == 0) {
      dvs.push_back(i);
    }
  }
  sort(dvs.begin(), dvs.end(), [](const auto& l, const auto& r) { return l > r; });
  cout << dvs[K - 1] << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   15 |   sort(dvs.begin(), dvs.end(), [](const auto& l, const auto& r) { return l > r; });
      |   ^~~~
      |   short
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:26: error: expected ';' before 'i'
    9 |   for(int i=max(a,b); i>0 i--){
      |                          ^~
      |                          ;
Language: C++

#include<iostream>
using namespace std;
int main()
{
  int a,b,k,d;
  cin>>a>>b>>k;
  int c[1000000];
  if(a>b)
    d=b;
  else
    d=a;
  i=1;int f=1;
  while(i<=d)
  {
    if(a%i==0&&b%i==0)
    {
      c[f]=i;f++;
    }
    i++;
    
  }
  cout<<c[k];
  return 0;
}
  

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:15: error: expected ';' before 'c'
    8 |   m = min(a,b)
      |               ^
      |               ;
    9 |   c = 0;
      |   ~
Language: C++

#include <iostream>
using namespace std;

int main(void)
{
	int A, B, K;
	cin >> A >> B >> K;
	vector<int> cd;
	for (int i = min(A, B); i > 0; i--) {
		if (A%i == 0 && B%i == 0)cd.push_back(i);
	}
	cout << cd[K - 1] << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'vector' was not declared in this scope
    8 |         vector<int> cd;
      |         ^~~~~~
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:16: error: expected primary-expression before 'int'
    8 |         vector<int> cd;
      |                ^~~
a.cc:10:42: error: 'cd' was not declared in this scope
   10 |                 if (A%i == 0 && B%i == 0)cd.push_back(i);
      |                                          ^~
a.cc:12:17: error: 'cd' was not declared in this scope
   12 |         cout << cd[K - 1] << endl;
      |                 ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    int A,B,K;
    cin >> A >> B >> K;
    vector<int> a,b;
    for (int i = 0; i < A; i++)
    {
        if (A%i==0)
        {
            a.push_back(i);
        }
        
    }
    for (int i = 0; i < B; i++)
    {
        if (B%i==0)
        {
            b.push_back(i);
        }
        
    }
    vector<int> c;
    for (int i = 0; i < a.size(); i++)
    {

        for (int j = 0; j < b.size(); j++)
        {
            if (a[i]==b[j])
            {
                c.push_back(a[i]);
            }
            
        }
        
        
    }
    sort(c.begin(),c.end(),greater<int>())
    cout << c.at(K-1) << endl;
    
    
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:43: error: expected ';' before 'cout'
   38 |     sort(c.begin(),c.end(),greater<int>())
      |                                           ^
      |                                           ;
   39 |     cout << c.at(K-1) << endl;
      |     ~~~~
Language: C++

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

int main()
{
  int a,b,k;
  cin>>a>>b>>k;
  vector<int> s;
  for(int i=1;i<=min(a,b);i++)
    if(a%i==0&&b%i==0) s.push_back(i);
  cout<<s[k-1]<<"\n";
  
  
  return 0;
}

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

#include<stdio.h>
int main()
{
 int a,b,k,i,j=2,m=0,f=0,z;
scanf("%d%d%d",&a,&b,&k);
while(f==0)
{
if(a%j==0&&b%j==0)
 m++;
if(m==k)
 {f=1;
z=j}
j++;
}
printf("%d",z);
return 0;}
  


Compiler output:
main.c: In function 'main':
main.c:12:4: error: expected ';' before '}' token
   12 | z=j}
      |    ^
      |    ;
Language: C++

#include<iostream>
using namespace std;
int main(){
int a,b,k,i,j,d[7]={0,0,0,0,0,0,0};
cin>>a>>b>>k;
if(b>a){i=b;b=a;a=i;}
i=0;
while(b){
j=b;
b=a%b;
a=d[i]=j;
i++;}
if(d[k-1]==0)
cout<<"Kth largest number that divides both the numbers doesn't exist."
else cout<<d[k-1];
return 0;}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:72: error: expected ';' before 'else'
   14 | cout<<"Kth largest number that divides both the numbers doesn't exist."
      |                                                                        ^
      |                                                                        ;
   15 | else cout<<d[k-1];
      | ~~~~
Language: C++

#include<iostream>
using namespace std;
void main(){
int a,b,k,i,j,d[7]={0,0,0,0,0,0,0};
cin>>a>>b>>k;
if(b>a){i=b;b=a;a=i;}
i=0;
while(b){
j=b;
b=a%b;
a=d[i]=j;
i++;}
if(d[k-1]==0)
cout<<"Kth largest number that divides both the numbers doesn't exist.";
else cout<<d[k-1];
}

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

#include<iostream>
using namespace std;
void main(){
int a,b,k,i,j,d[7]={0,0,0,0,0,0,0};
cin>>a>>b>>k;
if(b>a){i=b;b=a;a=i;}
i=0;
while(b){
j=b;
b=a%b;
a=d[i]=j;
i++;}
if(d[k-1]==0)
cout<<"Kth largest number that divides both the numbers doesn't exist."
else cout<<d[k-1];
}

Compiler output:
a.cc:3:1: error: '::main' must return 'int'
    3 | void main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:14:72: error: expected ';' before 'else'
   14 | cout<<"Kth largest number that divides both the numbers doesn't exist."
      |                                                                        ^
      |                                                                        ;
   15 | else cout<<d[k-1];
      | ~~~~
Language: C++

#include <iostream>
#include <vector>
#include <string>
#define ll long long; int
using namespace std;


int main(void) {
   int a, b, k;
   cin >> a >> b >> k;
   int n = max(a,b);
    vector<int> data(n+2,1e9);
   for(int i = 1; i <= n; i++) {
       if(a%i == 0 && b%i == 0) {
           data.at(i) = i;
       }
   }

    sort(data.begin(), data.end() );
   cout << data.at(k-1) << endl;
    return 0;
}

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

#include <iostream>
#include <vector>
#include <string>
#define ll long long; int
using namespace std;


int main(void) {
   int a, b, k;
   cin >> a >> b >> k;
   int n = max(a,b);
    vector<int> data(n+2,1e9);
   for(int i = 1; i <= n; i++) {
       if(a%i == 0 && b%i == 0) {
           data.at(i) = i;
       }
   }
   sort(data.begin(), data.end());
   cout << data.at(k-1) << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:4: error: 'sort' was not declared in this scope; did you mean 'short'?
   18 |    sort(data.begin(), data.end());
      |    ^~~~
      |    short