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

#include <bits/stdc++.h>
#include <atcoder/all>
#define int int64_t
#define REP(i, n) for (int i = 0; (i) < (int)(n); ++ (i))
#define REP3(i, m, n) for (int i = (m); (i) < (int)(n); ++ (i))
#define REP_R(i, n) for (int i = (int)(n) - 1; (i) >= 0; -- (i))
#define REP3R(i, m, n) for (int i = (int)(n) - 1; (i) >= (int)(m); -- (i))
#define REPP(i, n) for (int i = 1; (i) < (int)(n+1); ++ (i))
#define REPR(i, n) for (int i = (int)(n) - 1; (i) >= 0; -- (i))
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define FORR(i, m, n) for(int i=(m)-1; i>=(n); i--)
#define ALL(v) v.begin(), v.end()
#define endl "\n"
#define yes cout << "Yes" << endl
#define no cout << "No" << endl
using namespace std;
using Graph = vector<vector<int> >;
using WeightedGraph = vector<vector<pair<int, int> > >;
using LD = long double;
using VI = vector<int>;
using VVI = vector<vector<int> >;
using PII = pair<int, int>;
template <typename T> using V = vector<T>;
template <typename T> using VV = vector<vector<T> >;
template <typename T> using VVV = vector<vector<vector<T> > >;
void print() {cout << endl;}
template <typename Head, typename... Tail> void print(Head&& head, Tail&&... tail) {cout << head; if (sizeof...(tail) != 0) cout << " ";print(forward<Tail>(tail)...);}
template <typename T> void print(vector<T> &vec) {for (auto& a : vec) {cout << a; if (&a != &vec.back()) cout << " ";} cout << endl;}
template <typename T> void print(vector<vector<T>> &df) { for (auto& vec : df) { print(vec);}}
template <typename T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template <typename T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template <typename T> void SORT (T &v) {sort(v.begin(), v.end());}
template <typename T> void SORTR (T &v) {sort(v.begin(), v.end(), greater<>());}
template <typename T> T GCD(T x,T y) {return __gcd(x,y);}
template <typename T> T LCM(T x,T y) {return x/__gcd(x,y)*y;}
template <typename T> int SZ(T v) {return v.size();}
template <typename T> T PCNT(T x) {return __builtin_popcountll(x);}
template <typename T> T BIT(T x) {return 1LL<<(x);}
int INF = 2000000000;
long double PI = acosl(-1);
int MOD = 1000000007;


int32_t main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    cout << fixed << setprecision(10);
    int cnt = 0;
    
    int A, B, K;
    cin >> A >> B >> K;
    int G = __gcd(A, B);
    for (int i = G; i > 0; i--){
        if (G % i == 0){
            cnt++;
        }
        if (cnt == K){
            cout << i << endl;
            return 0;
        }
    }

    
    
    
    return 0;
}

/*
cd ~/Desktop/Programming/AtCoder/contest/abc120/abc120_b && sh shellscripts/test_cpp.sh
cd ~/Desktop/Programming/AtCoder/contest/abc120/abc120_b && sh shellscripts/etest_cpp.sh
cd ~/Desktop/Programming/AtCoder/contest/abc120/abc120_b && sh shellscripts/submit_cpp.sh
*/


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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: expected ';' before '<' token
    9 |     for(int i=0,i<100,++i){
      |                  ^
      |                  ;
a.cc:9:18: error: expected primary-expression before '<' token
a.cc:9:26: error: expected ';' before ')' token
    9 |     for(int i=0,i<100,++i){
      |                          ^
      |                          ;
Language: C++

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

int main(){
  int A, B, K, j=1, a=0;
  vector<int> devide_number;
  cin >> A >> B >> K;
  
  for(int i=0; i<=A; i++){
    if (A % i==0 && B % i==0){
      devide_number.at(j)=i;
      j++;
    }
  }
  
  a=devide_number.size()
  cout << devide_number.at(a-K) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:25: error: expected ';' before 'cout'
   16 |   a=devide_number.size()
      |                         ^
      |                         ;
   17 |   cout << devide_number.at(a-K) << endl;
      |   ~~~~
Language: C++

//#define _GLIBCXX_DEBUG
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
#define pp pair<int,int>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ld long double
#define al(a) (a).begin(),(a).end()
#define mk make_pair
#define check cout<<"?"<<endl;

ll MOD=1000000007;
ll mod=998244353;
int inf=1000001000;
ll INF=1e18+5;

int main(){
    int a,b,k,cnt=0; cin>>a>>b>>k;
    for(int i=1;i<=100;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:23:13: error: return-statement with no value, in function returning 'int' [-fpermissive]
   23 |             return;
      |             ^~~~~~
Language: C++

//#define _GLIBCXX_DEBUG
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
#define pp pair<int,int>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ld long double
#define al(a) (a).begin(),(a).end()
#define mk make_pair
#define check cout<<"?"<<endl;

ll MOD=1000000007;
ll mod=998244353;
int inf=1000001000;
ll INF=1e18+5;

int main(){
    int a,b,k,cnt=0; cin>>a>>b>>k;
    for(int i=1;i<=100;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:23:13: error: return-statement with no value, in function returning 'int' [-fpermissive]
   23 |             return ;;
      |             ^~~~~~
Language: C++

#include<iostream>

#include<cmath>

#include<vector>

using namespace std;

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

void common_divisor(int x,int k){

    vector<int> vec;

    for(int i=1;i*i<=x;++i){

        if(x%i==0){

            if(i*i==x)

                vec.push_back(i);

            else

               vec.push_back(i);

               vec.push_back(x/i);

        }

    }

   sort(vec.begin(),vec.end());

   cout<<vec[k-1];

}

            

int main()

{

    int a,b,k;

    cin>>a>>b>>k;

    int x=gcd(a,b);

    common_divisor(x,k);

}

Compiler output:
a.cc: In function 'void common_divisor(int, int)':
a.cc:33:4: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   33 |    sort(vec.begin(),vec.end());
      |    ^~~~
      |    sqrt
Language: C++

A, B, K = map(int,input().split())

C = min(A, B)

cnt = 0

while(1):
    if(A % C == 0 and B % C == 0):
        cnt+=1
    if(cnt == K):
        print(C)
        exit()
    C -= 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++.h>
using namespace std;

#define sc3(a,b,c)  scanf("%d %d %d",&a,&b,&c)

int main(){
    int a,b,k,n,m,ans;
    sc3(a,b,k);
    for (int i==100;i>0;i--) {
        if (a%i==0 && b%i==0) k--;
        if (k==0) {
            printf("%d\n",i);
            return 0;
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:15: error: expected ';' before '==' token
    9 |     for (int i==100;i>0;i--) {
      |               ^~
      |               ;
a.cc:9:15: error: expected primary-expression before '==' token
    9 |     for (int i==100;i>0;i--) {
      |               ^~
a.cc:9:24: error: expected ')' before ';' token
    9 |     for (int i==100;i>0;i--) {
      |         ~              ^
      |                        )
a.cc:9:25: error: 'i' was not declared in this scope
    9 |     for (int i==100;i>0;i--) {
      |                         ^
Language: C

#include <stdio.h>

int main(void)
{
	int A,B,K,s,p,i;
	int s[100];
	p = 0;
	scanf("%d %d %d",&A,&B,&K);
	for(i = 1;i <= A||i <= B;i++){
		if(A % i == 0 && B % i == 0){
			s[p] = i;
			p++;
		}
	}
	printf("%d\n",s[p - K]);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:13: error: conflicting types for 's'; have 'int[100]'
    6 |         int s[100];
      |             ^
main.c:5:19: note: previous declaration of 's' with type 'int'
    5 |         int A,B,K,s,p,i;
      |                   ^
Language: C++

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

int solve(int A, int B, int N)
{
  int a = A;
  int b = B;
  int n = N;
  int ans=0;
  int vector num();
  int m = min(A, B);
  for(int i=1; i<m; i++)
  {
    if(a % i == 0 && b % i == 0)
    {
      num.push_back(i); 
    }
  }
  ans = num.at(N);  
  return ans;
}
int main()
{
  int A, B, N;
  cin >> A >> B >> N;
  cout << solve(A, B, N) << endl;
  return 0;
}

  

Compiler output:
a.cc: In function 'int solve(int, int, int)':
a.cc:10:14: error: expected initializer before 'num'
   10 |   int vector num();
      |              ^~~
a.cc:16:7: error: 'num' was not declared in this scope; did you mean 'enum'?
   16 |       num.push_back(i);
      |       ^~~
      |       enum
a.cc:19:9: error: 'num' was not declared in this scope; did you mean 'enum'?
   19 |   ans = num.at(N);
      |         ^~~
      |         enum
Language: C++

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

int main () {
    int A, B, K;
    cin >> A >> B >> K;
    int small= min (A, B);
    int saidaikouyakusuu;

    for (int i=small; i>=1; i--) {
        if (A%i==0 && B%i==0) {
            saidaikouyakusuu=i;
            int count=0;
            for (int j=1; j<=saidaikouyakusuu; j++) {
                if (saidaikouyakusuu%j==0 ) {
                count++;
                if (count==K){
                    cout << j << endl;
                }                
            }
        }
    }
}


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

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

int main () {
    int A, B, K;
    cin >> A >> B >> K;
    int small= min (A, B);
    int saidaikouyakusuu;

    for (int i=small; i>=1; i--) {
        if (A%i==0 && B%i==0) {
             saidaikouyakusuu=i;
             int count=0;
             for (int j=1; j<=saidaikouyakusuu; j++) {
                 if (saidaikouyakusuu%j==0 ) {
                     count++;
                     if (count==K){
                         cout << j << endl;
                    }
                }
            }
        }
    }


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

a, b, k = map(int, input().split())
ans = 0
for i in reversed(range(1, 100)):
    if a % i == 0 and b % i == 0:
        ans += 1
        if ans == 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++

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

  int count=0;

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

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

#include <iostream>
using namespace std;

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

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

// ConsoleApplication1.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//

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

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

	vector<int> v;

	// odd numbers
	int j;
	for (int i = 1; i <= a && i <= b); i++) {
		if (a % i == 0 && b % i == 0) {
			v.push_back(i);
		}
	}
	sort(v.begin(), v.end(), greater<int>());

	int vsize = v.size();
	int ans = v.at(vsize - k);

	cout << ans << endl;
	return 0;

}

// プログラムの実行: Ctrl + F5 または [デバッグ] > [デバッグなしで開始] メニュー
// プログラムのデバッグ: F5 または [デバッグ] > [デバッグの開始] メニュー

// 作業を開始するためのヒント: 
//    1. ソリューション エクスプローラー ウィンドウを使用してファイルを追加/管理します 
//   2. チーム エクスプローラー ウィンドウを使用してソース管理に接続します
//   3. 出力ウィンドウを使用して、ビルド出力とその他のメッセージを表示します
//   4. エラー一覧ウィンドウを使用してエラーを表示します
//   5. [プロジェクト] > [新しい項目の追加] と移動して新しいコード ファイルを作成するか、[プロジェクト] > [既存の項目の追加] と移動して既存のコード ファイルをプロジェクトに追加します
//   6. 後ほどこのプロジェクトを再び開く場合、[ファイル] > [開く] > [プロジェクト] と移動して .sln ファイルを選択します


Compiler output:
a.cc: In function 'int main()':
a.cc:20:41: error: expected ';' before ')' token
   20 |         for (int i = 1; i <= a && i <= b); i++) {
      |                                         ^
      |                                         ;
a.cc:20:44: error: 'i' was not declared in this scope
   20 |         for (int i = 1; i <= a && i <= b); i++) {
      |                                            ^
Language: C++

// ConsoleApplication1.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//

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

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

	vector<int> v;

	// two's
	while (a % 2 == 0 && b % 2 == 0) {
		v.push_back(2);
		a = a / 2;
		b = b / 2;
	}

	// odd numbers
	for (int i = 1; (2 * i + 1 <= a && 2 * i + 1 <= b); i++) {
		if (a % (2 * i + 1) == 0 && b % (2 * i + 1) == 0) {
			v.push_back(2 * i + 1);
			i = i - 1;
		}
	}
	sort(v.begin(), v.end(), greater<int>());

	int vsize = v.size();
	int ans = 1;
	for (int i = 0; i < vsize - 1; i++) {
		ans = ans * v.at(i);
	}

	cout << ans << endl;
	return 0;

}

// プログラムの実行: Ctrl + F5 または [デバッグ] > [デバッグなしで開始] メニュー
// プログラムのデバッグ: F5 または [デバッグ] > [デバッグの開始] メニュー

// 作業を開始するためのヒント: 
//    1. ソリューション エクスプローラー ウィンドウを使用してファイルを追加/管理します 
//   2. チーム エクスプローラー ウィンドウを使用してソース管理に接続します
//   3. 出力ウィンドウを使用して、ビルド出力とその他のメッセージを表示します
//   4. エラー一覧ウィンドウを使用してエラーを表示します
//   5. [プロジェクト] > [新しい項目の追加] と移動して新しいコード ファイルを作成するか、[プロジェクト] > [既存の項目の追加] と移動して既存のコード ファイルをプロジェクトに追加します
//   6. 後ほどこのプロジェクトを再び開く場合、[ファイル] > [開く] > [プロジェクト] と移動して .sln ファイルを選択します


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

#include <iostream>
#include <stdio.h>
#include <vector> 
#include <math.h> 
using namespace std;
int main(void){
    int a,b,k; cin >> a >> b >> k;
    int i = 1;
    vector<int> num;
    while (i <= 100) {
        if (a % i == 0 && b % i == 0) num.push_back(i);
        i++;
    }
    sort(num.begin(), num.end(), greater<int>());
    cout << num[k-1] << endl;
}

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

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

#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rep2(i,s,n) for(int i = (s); i < (n); ++i)
#define ll long long
#define ld long double
#define P pair<ll,ll>
#define all(v) v.begin(),v.end()

const ll mod = 1e9+7;
const ll INF = 1e18;
const double pi = acos(-1.0);

ll f(ll n){
    ll sum=0;
    for(int i=1;i<=n;i++){
        if(n%i==0) sum++;
    }
    return sum;
}

int main(void)
{
    ll a,b,k; cin>>a>>b>>k;
    vector<ll> gcd;
    for(int i=1;i<=min(a,b);i++){
        if(a%i==0 && b%i==0) gcd.push_back(i);
    }
    reverse(all(gcd));
    cout<<gcd[k-1]<<endl;
 

Compiler output:
a.cc: In function 'int main()':
a.cc:31:26: error: expected '}' at end of input
   31 |     cout<<gcd[k-1]<<endl;
      |                          ^
a.cc:24:1: note: to match this '{'
   24 | {
      | ^
Language: C++

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

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


Compiler output:
a.cc:1:10: fatal error: iosteam: No such file or directory
    1 | #include <iosteam>
      |          ^~~~~~~~~
compilation terminated.
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:12: fatal error: bits / stdc ++. h : No such file or directory
    1 | # include  <bits / stdc ++. h >
      |            ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
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 <bits/stdc++.h>
using namespace std;
     
#define rep(i,n) for (int i = 0; i < (int)(n);i++)

int main() {
    int A,B,K,buf;
    vector<int> ans;
    cin >> A >> B >> K;
    int a=min(A,B);
    if(A==1){
        cout << 1 << endl;
        return 0;
    }
    for(int i=1;i<=b;i++){
        if(A%i==0&&B%i==0){
            ans.push_back(i);
        }
    }
    reverse(ans.begin(),ans.end());
    cout << ans.at(K-1) << endl;
}

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


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
const ll INF = 1LL << 60;



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

   int ans=0, kth=0;
   for(int i=1; i<=min(a,b); i++){
       if(a % i ==0 && b % i == 0) kth++;
       if(kth==k) ans = i;
   }
   cout << ans << i;

}

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:15: error: lvalue required as left operand of assignment
    9 |     if (A%X=0 && B%X=0){
      |             ~~^~~~~~
Language: Java

import java.util.Scanner;
public class Main{

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

        int count = 0;
        for(int i=1; count<K; i++){
            if(A%i ==0 && B%i==0){
                count ==;
            }
        }
        System.out.println(count);
   
       scan.close();
    }
}

Compiler output:
Main.java:13: error: illegal start of expression
                count ==;
                        ^
Main.java:13: error: not a statement
                count ==;
                      ^
2 errors
Language: Java

public class Main{

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

        int count = 0;
        for(int i=1; count<K; i++){
            if(A%i ==0 && B%i==0){
                count ==;
            }
        }
        System.out.println(count);
   
       scan.close();
    }
}

Compiler output:
Main.java:12: error: illegal start of expression
                count ==;
                        ^
Main.java:12: error: not a statement
                count ==;
                      ^
2 errors
Language: C++

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

int main(){
  int A,B,K,C;
  cin >> A >> B >> K;
  int count_C;
  if(A<B){
    C=A;
  }
  else{
    C=B;
  }
  for(int i=0;i<C;i++){
    if(A%i==0&&B%i==0){
      count_C+=1;
      if(count_C==K-1){
        break;
      }
    }
  }
  cout << count_C[K-1] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:18: error: invalid types 'int[int]' for array subscript
   22 |   cout << count_C[K-1] << endl;
      |                  ^
Language: C

#include <stdio.h>

int gcm(int a,int b)
{
        int x,y,r,tmp;
        if(a>b) {x=a;y=b};
        else   {x=b;y=a};
        r=x%y;
        if(r==0) return y;
        else return gcm(y,r);
}
int main(void)
{
        int a,b,k,i,g;
        scanf("%d%d%d",&a,&b,&k);

        g=gcm(a,b);
        for(i=1;i<g;i++){
                if(a%i==0 && b%i==0) k--;
                if(k==0) break;
        }
        printf("%d\n",i);
        return 0;
}


Compiler output:
main.c: In function 'gcm':
main.c:6:25: error: expected ';' before '}' token
    6 |         if(a>b) {x=a;y=b};
      |                         ^
      |                         ;
main.c:7:9: error: 'else' without a previous 'if'
    7 |         else   {x=b;y=a};
      |         ^~~~
main.c:7:24: error: expected ';' before '}' token
    7 |         else   {x=b;y=a};
      |                        ^
      |                        ;
Language: C

#include <stdio.h>

int gcm(int a,int b)
{
        int x,y,r,tmp;
        if(a>b) x=a;y=b;
        else    x=b;y=a;
        r=x%y;
        if(r==0) return y;
        else return gcm(y,r);
}
int main(void)
{
        int a,b,k,i,g;
        scanf("%d%d%d",&a,&b,&k);

        g=gcm(a,b);
        for(i=1;i<g;i++){
                if(a%i==0 && b%i==0) k--;
                if(k==0) break;
        }
        printf("%d\n",i);
        return 0;
}


Compiler output:
main.c: In function 'gcm':
main.c:7:9: error: 'else' without a previous 'if'
    7 |         else    x=b;y=a;
      |         ^~~~
Language: C

#include <stdio.h>

int gcm(int a,b)
{
        int x,y,r,tmp;
        if(a>b) x=a;y=b;
        else    x=b;y=a;
        r=x%y;
        if(r==0) return y;
        else return gcm(y,r);
}
int main(void)
{
        int a,b,k,i,g;
        scanf("%d%d%d",&a,&b,&k);

        g=gcm(a,b);
        for(i=1;i<g;i++){
                if(a%i==0 && b%i==0) k--;
                if(k==0) break;
        }
        printf("%d\n",i);
        return 0;
}


Compiler output:
main.c:3:15: error: unknown type name 'b'
    3 | int gcm(int a,b)
      |               ^
main.c: In function 'main':
main.c:17:11: error: implicit declaration of function 'gcm' [-Wimplicit-function-declaration]
   17 |         g=gcm(a,b);
      |           ^~~
Language: C++

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

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

    int min;
    if(A >= B)
        min = B;
    else
        min = A;

    int n[min];
    for(int i = 1; i <= min; i++){
        if(A % i == 0 %% B % i == 0)
            n[i - 1] = i;
    }

    sort(n, n+min, greater<>());

    cout << n[K - 1] << endl;
    return 0;
}

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

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

  int A=0,B=0,K=0,n=0;
  int num[100]={0};
  scanf("%d%d%d",&A,&B,&K);
  
  for(i=1;i<=100;i++){
  	if(A%i == 0 && B%i == 0){
    	num[n]=i;
      	n++;
    }
  }
  
  printf("%d",num[n-K]);
  
  
 return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:7: error: 'i' undeclared (first use in this function)
    9 |   for(i=1;i<=100;i++){
      |       ^
main.c:9:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

  int A=0,B=0,K=0,ans=0,len;
  scanf("%d%d%d",&A,&B,&K);
  num[100]={0};
  
  for(int i=1;i<=100;i++){
  	if(A%i == 0 && B%i == 0){
        num[i]=i;
    }
    len=strlen(num);
    if(len>K){
    	ans=num[i];
      	break;
    }
  }
  
  printf("%d",ans);


 return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:3: error: 'num' undeclared (first use in this function)
    6 |   num[100]={0};
      |   ^~~
main.c:6:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:12: error: expected expression before '{' token
    6 |   num[100]={0};
      |            ^
main.c:12:9: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
   12 |     len=strlen(num);
      |         ^~~~~~
main.c:2:1: note: include '<string.h>' or provide a declaration of 'strlen'
    1 | #include <stdio.h>
  +++ |+#include <string.h>
    2 | int main(void){
main.c:12:9: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
   12 |     len=strlen(num);
      |         ^~~~~~
main.c:12:9: note: include '<string.h>' or provide a declaration of 'strlen'
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:6:14: error: found ':' in nested-name-specifier, expected '::'
    6 |   int A, B, K:
      |              ^
      |              ::
a.cc:6:13: error: 'K' has not been declared
    6 |   int A, B, K:
      |             ^
a.cc:7:7: error: qualified-id in declaration before '>>' token
    7 |   cin >> A >> B >> K;
      |       ^~
a.cc:12:20: error: 'K' was not declared in this scope
   12 |       if (mod0cnt==K) {
      |                    ^
Language: C++

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

int main(){
    int a, b, k;
    cin >> a >> b >> k;
    vector<int> v;
    for (int i = 1; i * i <= a; i++)
    {
        if(a%i==0)
        {
            int n = i;
            int m = a % i;
            if (b % n == 0)
            {
                v.push_back(n);
            }
            if(b % m == 0)
            {
                v.push_back(m)
            }
        }
    }
    sort(v.rbegin(), v.rend());
    cout << v[k - 1] << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:31: error: expected ';' before '}' token
   22 |                 v.push_back(m)
      |                               ^
      |                               ;
   23 |             }
      |             ~
Language: C++

#include <iostream>
#include <set>
#define REP(i, n) for (int i = 0; i < (n); i++)
using namespace std;

set<int> divisorList(int n) {
    set<int> div;
    for (int i = 1; i <= n; i++) {
        if (n % i == 0){
            div.insert(i);
            if (i * i != n)
                div.insert(n / i);
        }
    }
    return div;
}

set<int> commonDivList(int a, int b) {
    set<int> aDiv = divisorList(a);
    set<int> bDiv = divisorList(b);
    set<int> res;
    set_intersection(aDiv.begin(), aDiv.end(),
            bDiv.begin(), bDiv.end(),
            inserter(res, res.end()));
    return res;
}

void solve(long long A, long long B, long long K){
    set<int> ans;
    ans = commonDivList(A, B);
    auto itr = ans.end();
    REP(i, K) itr--;
    cout << *itr << '\n';
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    long long A;
    scanf("%lld",&A);
    long long B;
    scanf("%lld",&B);
    long long K;
    scanf("%lld",&K);
    solve(A, B, K);
    return 0;
}


Compiler output:
a.cc: In function 'std::set<int> commonDivList(int, int)':
a.cc:22:5: error: 'set_intersection' was not declared in this scope
   22 |     set_intersection(aDiv.begin(), aDiv.end(),
      |     ^~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <vector>
#include<set>
#include<algorithm>
#include <queue>

using ll =  long long;
#define rep(i,n) for(int i= 0; i< (n); i++)
using namespace std;
using Graph = vector<vector<int>>;

int main(){

    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:22:17: error: return-statement with no value, in function returning 'int' [-fpermissive]
   22 |                 return;
      |                 ^~~~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: expected ';' before '}' token
   11 |       pq.push(i)
      |                 ^
      |                 ;
   12 |     }
      |     ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)
#define VL vector<ll>
#define VS vector<string>
#define VB vector<bool>
#define VP vector<pair<ll,ll>>
#define VVL vector<vector<ll>>
#define VVP vector<vector<pair<ll,ll>>>
#define PL pair<ll,ll>
#define ALL(v) (v).begin(), (v).end()

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

Compiler output:
a.cc: In function 'int main()':
a.cc:21:31: error: expected ';' before '}' token
   21 |         if(cnt==K){ans=i;break}
      |                               ^
      |                               ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
    ll A,B,K;
    ll cnt=0;
    ll ans=0;
    rep(i,1,101){
        if(A%i==0&&B%i==0)cnt++;
        if(cnt==K){ans=i;break}
    }
    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: 'll' was not declared in this scope
    4 |     ll A,B,K;
      |     ^~
a.cc:5:7: error: expected ';' before 'cnt'
    5 |     ll cnt=0;
      |       ^~~~
      |       ;
a.cc:6:7: error: expected ';' before 'ans'
    6 |     ll ans=0;
      |       ^~~~
      |       ;
a.cc:7:9: error: 'i' was not declared in this scope
    7 |     rep(i,1,101){
      |         ^
a.cc:7:5: error: 'rep' was not declared in this scope
    7 |     rep(i,1,101){
      |     ^~~
a.cc:11:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   11 |     cout<<ans<<endl;
      |           ^~~
      |           abs
Language: C++

#include <iostream>
#include <map>
#include <set>
using namespace std;

set<int> divisorList(int n) {
    set<int> div;
    for (int i = 1; i <= n; i++) {
        if (n % i == 0){
            div.insert(i);
            if (i * i != n)
                div.insert(n / i);
        }
    }
    return div;
}

set<int> commonDivList(int a, int b) {
    set<int> aDiv = divisorList(a);
    // for (auto n : aDiv)
    //     cout << n << ' ';
    // cout << '\n';
    set<int> bDiv = divisorList(b);
    // for (auto n : bDiv)
    //     cout << n << ' ';
    // cout << '\n';
    set<int> res;
    set_intersection(aDiv.begin(), aDiv.end(),
            bDiv.begin(), bDiv.end(),
            inserter(res, res.end()));
    return res;
}

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

    set<int> divList = commonDivList(a, b);
    // for (auto n : divList)
    //     cout << n << ' ';
    // cout << '\n';

    map<int, int> result;

    auto itr = divList.begin();
    for (int i = 0; i < divList.size(); i++) {
        result[i] = *itr;
        itr++;
    }
    cout << result[k - 1] << '\n';
    return 0;
}

Compiler output:
a.cc: In function 'std::set<int> commonDivList(int, int)':
a.cc:28:5: error: 'set_intersection' was not declared in this scope
   28 |     set_intersection(aDiv.begin(), aDiv.end(),
      |     ^~~~~~~~~~~~~~~~
Language: Java

import java.util.*;
public class ABC120b{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int k = sc.nextInt();
    sc.close();
    List<Integer> list = new ArrayList<>();
    for(int i = 0; i<Math.max(a,b);i++){
     	if(a%i==0&&b%i==0){
          list.add(i);
        }
    }
    System.out.println(list.get(list.size()-k));
  }
}

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

a, b, k = gets.split.map(&:to_i)
cnt = 0
1.step.each do |x|
  if a % x == 0 && b % x == 0
    cnt += 1
  end

  if cnt == k
    puts x
    break
  end
end

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

#include<bits/stdc++.h>
#include<cstdlib>
#include<cmath>
#include<map>
using namespace std;
int main(){
  int A; int B; int K; cin>>A>>B>>K;
  int N=0;
  int L=0;
  for(int i=0; i<N; i++){
    if(（i+1)%A==0&&(i+1)%B==0)
      L++;
    else continue;
  }
  vector<int> S(L);
  for(int i=0; i<A*B; i++){
    if((i+1)%A==0&&(i+1)%B==0){
S.at(N)=i+1;
      N++;
    }
      else continue;
    }
    cout<<S.at(K-1)<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:8: error: '\U0000ff08i' was not declared in this scope
   11 |     if(（i+1)%A==0&&(i+1)%B==0)
      |        ^~~
a.cc:11:14: error: expected primary-expression before '%' token
   11 |     if(（i+1)%A==0&&(i+1)%B==0)
      |              ^
Language: C++

#include<bits/stdc++.h>
#include<cstdlib>
#include<cmath>
#include<map>
using namespace std;
int main(){
  int A; int B; int K; cin>>A>>B>>K;
  int N=0;
  int L=0;
  for(int i=0; i<N; i++){
    if(A%(i+1)==0&&B%(i+1)==0)
      L++;
    else continue;
  }
  vector<int> S(L);
  for(int i=0; i<A*B; i++){
    if(A%(i+1)==0&&B%(i+1)==0){
S(N)=i+1;
      N++;
    }
      else continue;
    }
    cout<<S.at(K-1)<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:2: error: no match for call to '(std::vector<int>) (int&)'
   18 | S(N)=i+1;
      | ~^~~
Language: C++

#include<bits/stdc++.h>
#include<cstdlib>
#include<cmath>
#include<map>
using namespace std;
int main(){
  int A; int B; int K; cin>>A>>B>>K;
  int N=0;
  int L=0;
  for(int i=0; i<N; i++){
    if(A%(i+1)==&&B%(i+1)==0)
      L++;
    else continue;
  }
  vector<int> S(L);
  for(int i=0; i<A*B; i++){
    if(A%(i+1)==0&&B%(i+1)==0){
S(N)=i+1;
      N++;
    }
      else continue;
    }
    cout<<S.at(K-1)<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:20: error: invalid operands of types 'void*' and 'int' to binary 'operator%'
   11 |     if(A%(i+1)==&&B%(i+1)==0)
      |                 ~~~^~~~~~
      |                 |     |
      |                 void* int
a.cc:18:2: error: no match for call to '(std::vector<int>) (int&)'
   18 | S(N)=i+1;
      | ~^~~
a.cc:11:19: error: label 'B' used but not defined
   11 |     if(A%(i+1)==&&B%(i+1)==0)
      |                   ^
Language: C++

#include<bits/stdc++.h>
#include<cstdlib>
#include<cmath>
#include<map>
using namespace std;
int main(){
  int A; int B; int K; cin>>A>>B>>K;
  int N=0;
  vector<int> S;
  for(int i=0; i<A*B; i++){
    if(A%(i+1)==0&&B%(i+1)==0){
S(N)=i+1;
      N++;
    }
      else continue;
    }
    cout<<S.at(K-1)<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:2: error: no match for call to '(std::vector<int>) (int&)'
   12 | S(N)=i+1;
      | ~^~~
Language: C++

#include<bits/stdc++.h>
#include<cstdlib>
#include<cmath>
#include<map>
using namespace std;
int main(){
  int A; int B; int K; cin>>A>>B>>K;
  int N=0;
  vector<int> S(K);
  for(int i=0; i<A*B; i++){
    if(A%(i+1)==0&&B%(i+1)==0){
S(N)=i+1;
      N++;
    }
      else continue;
    }
    cout<<S.at(K-1)<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:2: error: no match for call to '(std::vector<int>) (int&)'
   12 | S(N)=i+1;
      | ~^~~
Language: C++

#include<bits/stdc++.h>
#include<cstdlib>
#include<cmath>
#include<map>
using namespace std;
int main(){
  int A; int B; int K; cin>>A>>B>>K;
  vector<int> S(K);
  for(int i=0; i<A*B; i++){
    if(A%(i+1)==0&&B%(i+1)==0){
S(i)=i+1;
    }
      else continue;
    }
    cout<<S.at(K-1)<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:2: error: no match for call to '(std::vector<int>) (int&)'
   11 | S(i)=i+1;
      | ~^~~
Language: C++

#include<bits/stdc++.h>
#include<cstdlib>
#include<cmath>
#include<map>
using namespace std;
int main(){
  int A; int B; int K; cin>>A>>B>>K;
  vector<int> S(K);
  for(int i=0; i<A*B; i++){
    if(A%(i+1)==0&&B%(i+1)==){
S(i)=i+1;
    }
      else continue;
    }
    cout<<S.at(K-1)<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:29: error: expected primary-expression before ')' token
   10 |     if(A%(i+1)==0&&B%(i+1)==){
      |                             ^
a.cc:11:2: error: no match for call to '(std::vector<int>) (int&)'
   11 | S(i)=i+1;
      | ~^~~
Language: C++

#include<bits/stdc++.h>
#include<cstdlib>
#include<cmath>
#include<map>
using namespace std;
int main(){
  int A; int B; int K; cin>>A>>B>>K;
  vector<int> S(N)
  for(int i=0; i<A*B; i++){
    if(A%(i+1)==0&&B%(i+1)==){
S(i)=i+1;
    }
      else continue;
    }
    cout<<S.at(K-1)<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:17: error: 'N' was not declared in this scope
    8 |   vector<int> S(N)
      |                 ^
a.cc:9:3: error: expected ',' or ';' before 'for'
    9 |   for(int i=0; i<A*B; i++){
      |   ^~~
a.cc:9:16: error: 'i' was not declared in this scope
    9 |   for(int i=0; i<A*B; i++){
      |                ^
Language: C++

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

int main(){
  int A , B , K ;
  cin >> A >> B >> K ;
  vector<int> A(100);
  for(int i=1;i<=100;i++){
    if(A%i==0&&B%i==0) A[i]==i;
  }
  
  sort(A.begin(),A.end());
  reverse(A.begin(),A.end());
  
  cout << A[K-1] << endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:15: error: conflicting declaration 'std::vector<int> A'
    7 |   vector<int> A(100);
      |               ^
a.cc:5:7: note: previous declaration as 'int A'
    5 |   int A , B , K ;
      |       ^
a.cc:9:25: error: invalid types 'int[int]' for array subscript
    9 |     if(A%i==0&&B%i==0) A[i]==i;
      |                         ^
a.cc:12:10: error: request for member 'begin' in 'A', which is of non-class type 'int'
   12 |   sort(A.begin(),A.end());
      |          ^~~~~
a.cc:12:20: error: request for member 'end' in 'A', which is of non-class type 'int'
   12 |   sort(A.begin(),A.end());
      |                    ^~~
a.cc:13:13: error: request for member 'begin' in 'A', which is of non-class type 'int'
   13 |   reverse(A.begin(),A.end());
      |             ^~~~~
a.cc:13:23: error: request for member 'end' in 'A', which is of non-class type 'int'
   13 |   reverse(A.begin(),A.end());
      |                       ^~~
a.cc:15:12: error: invalid types 'int[int]' for array subscript
   15 |   cout << A[K-1] << endl;
      |            ^
Language: C++

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

int main(){
  int a,b,k,nm=0,at=1;
  cin>>a>>b>>k;
  while(nm<k){
    if(a&at==0&&b&at==0){
      at++;
      nu++;
    }
    else{
      at++;
    }
  }
  cout<<at<<endl;
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:10:7: error: 'nu' was not declared in this scope; did you mean 'nm'?
   10 |       nu++;
      |       ^~
      |       nm
Language: C++

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

int main(){
  int a,b,k,nm=0,at=1;
  cin>>a>>b>>k;
  while(nm<k){
    if(a&at==0&&b&at==0){
      at++;
      nu++;
    }
    else{
      at++;
  }
  cout<<at<<endl;
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:10:7: error: 'nu' was not declared in this scope; did you mean 'nm'?
   10 |       nu++;
      |       ^~
      |       nm
a.cc:16:2: error: expected '}' at end of input
   16 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include<bits/stdc++.h>
#define INF 2000000000
#define MOD 1000000007
#define EPS (1e-10)

using namespace std;

int main(int argc, char *argv[]) {
	int A,B; cin >> A >> B;
	int K; cin >> K;


	int cnt = 0;


	vector<int> ans(100);
	for (int i = 1; i <= 100; i++) {
		if (A % i == 0 and B % i == 0) {
			ans.push_back(i);
		}
	}
	ans.size() - 4cout << ans[ans.size() - 4] << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:22:22: error: unable to find numeric literal operator 'operator""cout'
   22 |         ans.size() - 4cout << ans[ans.size() - 4] << endl;
      |                      ^~~~~
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();
      int count = 0;
      int ans = 0;
      While(count<k){ans++;if(a%ans==0 &&b%ans==0){count++;}
                    }
	  System.out.println(ans);
  }
}


Compiler output:
Main.java:10: error: ';' expected
      While(count<k){ans++;if(a%ans==0 &&b%ans==0){count++;}
                    ^
1 error
Language: C++

#include <iostream>
#include <string>
#include <cmath> //これはlogを使うときに必要
using namespace std;

int main() {
  int a, b, k;
  cin >> a >> b >> k;
  vector<int> vec;
  for(int i = 1; i <= min(a,b); i++) {
    if(a % i == 0 && b % i == 0) {
      vec.push_back(i);
    }
  }
  int size = vec.size();
  int ans = vec.at(size - k + 1);
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'vector' was not declared in this scope
    9 |   vector<int> vec;
      |   ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    3 | #include <cmath> //これはlogを使うときに必要
  +++ |+#include <vector>
    4 | using namespace std;
a.cc:9:10: error: expected primary-expression before 'int'
    9 |   vector<int> vec;
      |          ^~~
a.cc:12:7: error: 'vec' was not declared in this scope
   12 |       vec.push_back(i);
      |       ^~~
a.cc:15:14: error: 'vec' was not declared in this scope
   15 |   int size = vec.size();
      |              ^~~
Language: C++

#include <iostream>
#include <string>
#include <cmath> //これはlogを使うときに必要
using namespace std;

int main() {
  int a, b, k;
  cin >> a >> b >> k;
  vector<int> vec;
  for(int i = 1; i <= min(a,b); i++) {
    if(a % i == 0　&& b % i == 0) {
      vec.push_back(i);
    }
  }
  int size = vec.size();
  int ans = vec.at(size - k + 1);
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc:11:17: error: extended character 　 is not valid in an identifier
   11 |     if(a % i == 0　&& b % i == 0) {
      |                 ^
a.cc: In function 'int main()':
a.cc:9:3: error: 'vector' was not declared in this scope
    9 |   vector<int> vec;
      |   ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    3 | #include <cmath> //これはlogを使うときに必要
  +++ |+#include <vector>
    4 | using namespace std;
a.cc:9:10: error: expected primary-expression before 'int'
    9 |   vector<int> vec;
      |          ^~~
a.cc:11:17: error: unable to find numeric literal operator 'operator""\U00003000'
   11 |     if(a % i == 0　&& b % i == 0) {
      |                 ^~~
a.cc:12:7: error: 'vec' was not declared in this scope
   12 |       vec.push_back(i);
      |       ^~~
a.cc:15:14: error: 'vec' was not declared in this scope
   15 |   int size = vec.size();
      |              ^~~
Language: C++

#include <iostream>

int gcd(int m,int n)
{
  if(l<r)
  {
    int t=m;
    m=n;
    n=t;
  }
  
  for(;;)
  {
    if(n==0)
      return m;
    
    int t=m%n;
    m=n;
    n=t;
  }
}

int main()
{
  int A,B,K;
  std::cin>>A>>B>>K;
  
  int g=gcd(A,B);
  
  int count=0;
  for(int i=g;i!=0;i++)
  {
    if(g%i==0)
    {
      count++;
      if(count==K)
      {
        std::cout<<i<<std::endl;
        break;
      }
    }
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:5:6: error: 'l' was not declared in this scope
    5 |   if(l<r)
      |      ^
a.cc:5:8: error: 'r' was not declared in this scope
    5 |   if(l<r)
      |        ^
Language: C++

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


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

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

#include<iostream>
using namespace std;
int main()
{
int a,b,k,m=0,j,t;
cin>>a>>b>>k;
if(a<b)
    {
        t=a;
        a=b;
        b=t;
    }
    for( j=b;j>0;j--)
    {
        if(b%j==0&&a%j==0)
            m++;
           if(m==k)
              {

               cout<<j<<endl;
          return 0; }

    }

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

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


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

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

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'nmaespace'
    2 | using nmaespace std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin>>a>>b>>k;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:13:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   13 |   cout<<i;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:13:9: error: 'i' was not declared in this scope
   13 |   cout<<i;
      |         ^