criyle/codenet-compile-errors huggingface dataset:
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,1e19);
   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:12:26: warning: overflow in conversion from 'double' to 'std::vector<int>::value_type' {aka 'int'} changes value from '1.0e+19' to '2147483647' [-Woverflow]
   12 |     vector<int> data(n+2,1e19);
      |                          ^~~~
a.cc:18:4: error: 'sort' was not declared in this scope; did you mean 'short'?
   18 |    sort(data.begin(), data.end());
      |    ^~~~
      |    short
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:28: error: no pre-increment operator for type
    7 |     if(a%i==0 && b%i==0) ++count;
      |                            ^~~~~
a.cc:8:13: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator=='
    8 |     if(count==k){
      |        ~~~~~^~~
Language: C++

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

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

/* 実行時間1s制限の場合
  10^6 1,000,000   : 余裕をもって間に合う
  10^7 10,000,000  : おそらく間に合う
  10^8 100,000,000 : 非常にシンプルな処理でないと厳しい
 */
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#include <bits/stdc++.h>
using namespace std;

typedef long long ll; // long longはデータモデル(LLP64, LP64, ...)によらず64bit.
ll gcd(ll a, ll b) {return b ? gcd(b, a%b) : a;}  // Greatest Common Divisor ユークリッドの互除法（aが長辺）
vector<pair<ll,int>> factorize(ll n) {            // a,bの公約数 = GCD(a, b)の約数
    vector<pair<ll,int>> res;
    for (ll i = 2; i*i <= n; i++) { // √nまで探せばよい
        if (n%i) continue;
        res.emplace_back(i, 0);     // 割り切れたら
        while (n%i == 0) {
            n /= i;
            res.back().second++;
        }
    }
    if (n != 1) res.emplace_back(n, 1); // この時点で1でなかったら、残りは素数.
    return res;
}
ll lcm(ll a, ll b) {return a/gcd(a,b)*b;}         // Least Commont Multiple オーバーフローしないように先に割る
ll ceil(ll a, ll b) {return (a+b-1)/b;}

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

int main(int argc, char* argv[])
{
#ifdef LOCAL
    // 以降 cin の入力元が 'xxx.txt' になる
    // std::ifstream in(argv[1]);
    //std::cin.rdbuf(in.rdbuf());
    std::ifstream in("b.txt");
    std::cin.rdbuf(in.rdbuf());
#endif

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

    int cnt = 0;

    for (int i = 1; i < a * b*c; i++) {
        if ( ((a%i)==0) && ((b%i)==0)) {
            cnt++;
        }
        if (cnt == k)
        {
            cout << i;
            break;
        }
    }


    return 0;
}

/*
  - 1e9 : 10^9
  - container一般
    - 合計
      accumulate(a.begin(), a.end(), 0LL)  0LLはオーバーフロー用
  - vector
    vector<int> A(N, 0); // 0で初期化(省略可)
    - loop
      for  (int i = 0; i < A.size(); i++) {}
      for  (int elem : A) {}
    - sort
      std::sort(v.begin(), v.end());  // 昇順
      std::sort(v.begin(), v.end(), std::greater<int>()); //降順
      - vector<vector<int>> cnt(h, vector<int>(w))
    - sort(struct)
        struct st_t {
            string name;
            int p;
            bool operator<(const st_t& another) const {
                if (name == another.name)
                {
                    return p > another.p;
                }
                return name < another.name;
            }
        };
        vector<st_t> st(n);
        sort(st.begin(), st.end());
  - pair
    - pairのソートの定義 : firstが優先的に比較。同じだったらsecond。
    - pair<pair<string,int>,int> p[110];
      std::sort(p,p+a);
        こうすると、first.first -> first.second -> secondの順にソートされる
    - sort
      - sort(a.begin(), cb.end(), greater<pair<int, int>>());
  - map
    - for (auto x : map) {}  // x.first:key  x.second:value.
  - priority_queue<int> q;
    - q.top()に最大値が入っている
  - string
    - loop
      for (char& c : s) {}
 */



Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:48:31: error: 'c' was not declared in this scope
   48 |     for (int i = 1; i < a * b*c; i++) {
      |                               ^
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(i%a==0&&i%b==0){
    ar[t]=i;
    t++;
  }
  
  }
  printf("%d",a[t-k]);

  

return 0;
}

Compiler output:
main.c: In function 'main':
main.c:26:16: error: subscripted value is neither array nor pointer nor vector
   26 |   printf("%d",a[t-k]);
      |                ^
Language: C

#include<stdio.h>


int main()
{
int a,b,k;
  
  scanf("%d%d%d",&a,&b,&k);
  
  int min;
  int a[1000];
  int t=0;
  if(a<=b)
    min=a;
  
  else
    min=b;
  
  for(int i=1;i<=min;i++){
  if(i%a==0&&i%b==0){
    a[t]=i;
    t++;
  }
  
  }
  printf("%d",a[n-k]);

  

return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:7: error: conflicting types for 'a'; have 'int[1000]'
   11 |   int a[1000];
      |       ^
main.c:6:5: note: previous declaration of 'a' with type 'int'
    6 | int a,b,k;
      |     ^
main.c:26:17: error: 'n' undeclared (first use in this function)
   26 |   printf("%d",a[n-k]);
      |                 ^
main.c:26:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define INF 1000000010
#define EPS 1e-9
#define fst first
#define scd second

#define debug(x) cout<<x<<endl;
#define repi(i,x,n) for(int i=x;i<n;i++)
#define rep(i,n) repi(i,0,n)
#define lp(i,n) repi(i,0,n)
#define repn(i,n) for(int i=n;i>=0;i--)
#define int long long
#define endl "\n"


signed main(){
  cin.tie(0);	
  ios::sync_with_stdio(false);
  int a,b,k;
  cin>>a>>b>>k;
  int cnt=0;
  repi(i,1,1000){
    if(a%i==0 && b%i==0){
      cnt++:
    }
    if(cnt==k){cout<<i<<endl;return 0;}
  }


  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:12: error: expected ';' before ':' token
   26 |       cnt++:
      |            ^
      |            ;
Language: C++


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

Compiler output:
a.cc: In function 'int main()':
a.cc:14:10: error: expected primary-expression before '%' token
   14 |     if(a%%i ==0 && b%%i ==0 ){
      |          ^
a.cc:14:22: error: expected primary-expression before '%' token
   14 |     if(a%%i ==0 && b%%i ==0 ){
      |                      ^
Language: C++

Problem Statement
There are N gems. The value of the i-th gem is Vi.

You will choose some of these gems, possibly all or none, and get them.

However, you need to pay a cost of Ci to get the i-th gem.

Let X be the sum of the values of the gems obtained, and Y be the sum of the costs paid.

Find the maximum possible value of X−Y.

Constraints
All values in input are integers.
1≤N≤20
1≤Ci,Vi≤50
Input
Input is given from Standard Input in the following format:

N
V1 V2 … VN
C1 C2 … CN
Output
Print the maximum possible value of X−Y.

Sample Input 1
3
10 2 5
6 3 4
Sample Output 1
5
If we choose the first and third gems, X=10+5=15 and Y=6+4=10. We have X−Y=5 here, which is the maximum possible value.

Sample Input 2
4
13 21 6 19
11 30 6 15
Sample Output 2
6
Sample Input 3
1
1
50
Sample Output 3
0

Compiler output:
a.cc:10:36: error: extended character − is not valid in an identifier
   10 | Find the maximum possible value of X−Y.
      |                                    ^
a.cc:14:1: error: extended character ≤ is not valid in an identifier
   14 | 1≤N≤20
      | ^
a.cc:14:1: error: extended character ≤ is not valid in an identifier
a.cc:15:1: error: extended character ≤ is not valid in an identifier
   15 | 1≤Ci,Vi≤50
      | ^
a.cc:15:6: error: extended character ≤ is not valid in an identifier
   15 | 1≤Ci,Vi≤50
      |      ^
a.cc:20:7: error: extended character … is not valid in an identifier
   20 | V1 V2 … VN
      |       ^
a.cc:21:7: error: extended character … is not valid in an identifier
   21 | C1 C2 … CN
      |       ^
a.cc:23:37: error: extended character − is not valid in an identifier
   23 | Print the maximum possible value of X−Y.
      |                                     ^
a.cc:31:72: error: extended character − is not valid in an identifier
   31 | If we choose the first and third gems, X=10+5=15 and Y=6+4=10. We have X−Y=5 here, which is the maximum possible value.
      |                                                                        ^
a.cc:1:1: error: 'Problem' does not name a type
    1 | Problem Statement
      | ^~~~~~~
Language: C++

#include<iostream>
#include<vector>
using namespace std;
ll GCD(ll a, ll b){ return b?GCD(b, a % b):a; }
vector<long long> factorize(long long n){
vector<long long> b;
long long a=2,cnt=0;
while (n >= a * a) {
        if (n % a == 0) {
            b[cnt]++;
            n /= a;
          if(n%a!=0){
            cnt++;}
        } else {
            a++;
        }
}
if(n!=1){
b[cnt]++;
}
return b;
}
int main(){
  long long a,b,k,gc;
  cin>>a>>b>>k;
  gc=GCD(a,b);
  vector<long long> mp;
  mp=factorize(gc);
  cout<<mp[(int)mp.size()-k]<<endl;
  return 0;
}

  
  


Compiler output:
a.cc:4:1: error: 'll' does not name a type
    4 | ll GCD(ll a, ll b){ return b?GCD(b, a % b):a; }
      | ^~
a.cc: In function 'int main()':
a.cc:26:6: error: 'GCD' was not declared in this scope
   26 |   gc=GCD(a,b);
      |      ^~~
Language: C++

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

int main() {
    int a, b,c,d[100];
    cin >> a >> b>>c;
   
  for(int i =0;i<100;i++){
    if((a%i ==0)&&(b%i ==0)){
      d[i] =i;
    }
  }
  
  sort(d,d+100,greater<int>());
  
  cout << d[k-1] << endl;
}
  
  

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

#include <iostream>
using namespace std;

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 += 1;
      if (cnt == K){
        cout << i << endl;
        return 0}
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: expected ';' before '}' token
   13 |         return 0}
      |                 ^
      |                 ;
Language: C++

#include <iostream>
using namespace std;

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

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

#include <cstdio>

template<typename T>
T gcd(T a, T b)
{
	if (a < b) return gcd(b, a);
	T r;
	while (r = a % b)
	{
		a = b;
		b = r;
	}
	return b;
}

int main()
{
  int a, b, k;
  scanf("%d %d %d", &a, &b, &k);
  
  int g = gcd(a, b);
  
  int c = 0;
  for (int i = g; i > 0; --i)
  {
    if (a % i == 0 && b % 1 == 0)
    {
      ++c;
      if (c == k)
      {
        printf("%d\n", i);
        return 0;
      }
    }
  }
  return 0;
}
  }

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:29: error: overloaded function with no contextual type information
    7 |   cin >> a >> b >> k, count=0;
      |                             ^
a.cc:10:12: error: no post-increment operator for type
   10 |       count++;
      |            ^~
a.cc:11:14: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator=='
   11 |     if(count == k) {
      |        ~~~~~~^~~~
Language: C++

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

int int_len(int n) {
  int s=0;
  while(n!=0) s++, n/=10;
  return s;
}

int int_sum(int n) {
  int m=0,s=0,a=n;
  while(a!=0) s++, a/=10;
  for(int i=s-1;i>=0;i--) m+=n/((int)pow(10,i))-(n/((int)pow(10,i+1)))*10;
  return m;
}


int vec_sum(vector<int> v){
  int n=0;
  for(int i=0;i<v.size();i++) n+=v[i];
  return n;
}

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


Compiler output:
a.cc: In function 'int main()':
a.cc:32:38: error: expected primary-expression before ')' token
   32 |   sort(v.begin(),v.end(),greater<int>);
      |                                      ^
Language: C++

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

int int_len(int n) {
  int s=0;
  while(n!=0) s++, n/=10;
  return s;
}

int int_sum(int n) {
  int m=0,s=0,a=n;
  while(a!=0) s++, a/=10;
  for(int i=s-1;i>=0;i--) m+=n/((int)pow(10,i))-(n/((int)pow(10,i+1)))*10;
  return m;
}


int vec_sum(vector<int> v){
  int n=0;
  for(int i=0;i<v.size();i++) n+=v[i];
  return n;
}

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


Compiler output:
a.cc: In function 'int main()':
a.cc:28:16: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   28 |   vector<int> v();
      |                ^~
a.cc:28:16: note: remove parentheses to default-initialize a variable
   28 |   vector<int> v();
      |                ^~
      |                --
a.cc:30:28: error: request for member 'push_back' in 'v', which is of non-class type 'std::vector<int>()'
   30 |     if(a%i==0 && b%i==0) v.push_back(i);
      |                            ^~~~~~~~~
a.cc:32:10: error: request for member 'begin' in 'v', which is of non-class type 'std::vector<int>()'
   32 |   sort(v.begin(),v.end(),greater<int>);
      |          ^~~~~
a.cc:32:20: error: request for member 'end' in 'v', which is of non-class type 'std::vector<int>()'
   32 |   sort(v.begin(),v.end(),greater<int>);
      |                    ^~~
a.cc:32:38: error: expected primary-expression before ')' token
   32 |   sort(v.begin(),v.end(),greater<int>);
      |                                      ^
a.cc:33:14: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   33 |   cout<<v[k-1]<<endl;
      |              ^
cc1plus: warning: pointer to a function used in arithmetic [-Wpointer-arith]
Language: C++

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

using namespace std;
int main()
{ vector<int> v;

int a,b,k;
  cin>>a>>b>>k;
  int l=0;
  
  for(int i=1;i<=gcd(a,b);i++)
  { if(gcd(a,b)%i==0)
      v.push_back(i);
  }
 cout<<v[v.size()-k-1];
   
return 0;

}

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

#inlcude<iostream>
#include<algorithm>
using namespace std;
imt main()
{

int a,b,k;
  cin>>a>>b>>k;
  int l=0;
  for(int i=1;i<=max(a,b);i++)
  {if(a%i==0 $$ b%i==0)
  {  l++;
      if (l==k)
      {cout<<i;break;}
  
  }
return 0;

}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inlcude; did you mean #include?
    1 | #inlcude<iostream>
      |  ^~~~~~~
      |  include
a.cc:4:1: error: 'imt' does not name a type; did you mean 'int'?
    4 | imt main()
      | ^~~
      | int
Language: C++

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

int main(){
  int A,B,K;
  cin>>A>>B>>K;
  int leng=100;
  vector<int> A_l;
  int count;
  if(A>B)count=B;
  else count=A;
  int C =0;

  for(int i=0;i<count;i++){
    int num=i+1;
    if(A%num==0&&B%num==0){
      A_l.push_back(num);
    cout<<num<<endl;
  }
  }
  sort(A_l.begin(),A_l.end(),greater<int>())
  cout<<A_l.at(K-1)<<endl;
  return 0;
}


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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: no match for 'operator-' (operand types are 'int' and 'std::vector<int>')
   14 |   ans=d.at(s-d+1);
      |            ~^~
      |            | |
      |            | std::vector<int>
      |            int
In file included from /usr/include/c++/14/string:48,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_iterator.h:618:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
  618 |     operator-(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:618:5: note:   template argument deduction/substitution failed:
a.cc:14:14: note:   mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
   14 |   ans=d.at(s-d+1);
      |              ^
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
 1790 |     operator-(const move_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note:   template argument deduction/substitution failed:
a.cc:14:14: note:   mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
   14 |   ans=d.at(s-d+1);
      |              ^
Language: C++

#include<iostream>
using namespace std;
int main(){
  int a,b,k,count=0,ans;
  cin>>a>>b>>k;
  for(int i=0,i<a;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:6:16: error: expected ';' before '<' token
    6 |   for(int i=0,i<a;i++){
      |                ^
      |                ;
a.cc:6:16: error: expected primary-expression before '<' token
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++)
 
int main() {
  int a,b,k,ans;
  cin>>a>>b>>k;
  int c=min(a,b);
  int ans;
  for(int i=c;i>=1;i--){
    if(a%i==0&&b%i==0){
      k--;
    }
    if(k==0){
      ans=i;
      break;
    }
  }
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:7: error: redeclaration of 'int ans'
   10 |   int ans;
      |       ^~~
a.cc:7:13: note: 'int ans' previously declared here
    7 |   int a,b,k,ans;
      |             ^~~
Language: C++

A,B,K=map(int,input().split())
R=[]
for i in range(1,min(A,B)+1):
  if A%i==0 and B%i==0:
    R.append(i)
print(R[-K])

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;
int main(){
  
  int a, b, k;
  cin >> a >> b >> k;
  
  int s, t, u;
  s = min(a, b);
  t = 1;
  u = 0;
  
  while(u < k){
      if(((a%s) == 0)) && ((b%s) == 0)){
        t = s;
        u++;
      }
      s--;
  }
  cout << t << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:27: error: expected identifier before '(' token
   14 |       if(((a%s) == 0)) && ((b%s) == 0)){
      |                           ^
Language: C++

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

int main() {
	int a, b, k;
	for (int i = 1;i < 200;++i) {
		if (a % i == 0 && b % i == 0)--k;
	}
	if (k == 0)cout << i << endl;
}

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:28: error: 'i' was not declared in this scope
   11 |         if (k == 0)cout << i << 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 q;
		int count=0;
		int answer=0;
		if(b>a){
			q=a;
			a=b;
			b=q
		}

		for(int i=b;i>0;i--){
			if(a%i==0 && b%i==0){
				count++;
				if(count==q){
					answer=i;
					break;
				}
			}
		}

		System.out.println(answer);

	}
}


Compiler output:
Main.java:17: error: ';' expected
			b=q
			   ^
1 error
Language: C++

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

int main(void) {
  int a,b,k,k=0;;
  std::cin>> a >> b >> k;
  std::vector<int> a(100);
  for(int i=0;i<k;i++){
    while(1){
  if(a%i==0 && b%i==0){
  
    a.at(k)=i;
      k++;
  }
    }
  }
  std::cout<< a.at(k) << std::endl;

  // ここにプログラムを追記
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:13: error: redeclaration of 'int k'
    5 |   int a,b,k,k=0;;
      |             ^
a.cc:5:11: note: 'int k' previously declared here
    5 |   int a,b,k,k=0;;
      |           ^
a.cc:7:20: error: conflicting declaration 'std::vector<int> a'
    7 |   std::vector<int> a(100);
      |                    ^
a.cc:5:7: note: previous declaration as 'int a'
    5 |   int a,b,k,k=0;;
      |       ^
a.cc:12:7: error: request for member 'at' in 'a', which is of non-class type 'int'
   12 |     a.at(k)=i;
      |       ^~
a.cc:17:17: error: request for member 'at' in 'a', which is of non-class type 'int'
   17 |   std::cout<< a.at(k) << std::endl;
      |                 ^~
Language: C++

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

int main() {
  int a,b,k;
  std::cin>> a >> b >> k;
  vector<int> a(100);
  for(int i=0;i<k;i++){
  if(a%i==0 && b%i==0){
  std::cin>> a.at(i)=i;
  }
  }
  std::cout<< a.at(k-1) << std::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:10:16: error: request for member 'at' in 'a', which is of non-class type 'int'
   10 |   std::cin>> a.at(i)=i;
      |                ^~
a.cc:13:17: error: request for member 'at' in 'a', which is of non-class type 'int'
   13 |   std::cout<< a.at(k-1) << std::endl;
      |                 ^~
Language: C++

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

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

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


Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | 1#include<bits/stdc++.h>
      |  ^
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 1#include<bits/stdc++.h>
      | ^
a.cc: In function 'int main()':
a.cc:11:5: error: 'cin' was not declared in this scope
   11 |     cin >> a >> b >> k;
      |     ^~~
a.cc:23:5: error: 'cout' was not declared in this scope
   23 |     cout << ans << endl;
      |     ^~~~
a.cc:23:20: error: 'endl' was not declared in this scope
   23 |     cout << ans << endl;
      |                    ^~~~
a.cc: In function 'int gcd(int, int)':
a.cc:6:8: warning: control reaches end of non-void function [-Wreturn-type]
    6 |     gcd(b,a%b);
      |     ~~~^~~~~~~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:14:24: error: no matching function for call to 'end()'
   14 |   reverse(x.begin(),end());
      |                     ~~~^~
In file included from /usr/include/c++/14/bits/algorithmfwd.h:39,
                 from /usr/include/c++/14/bits/stl_algo.h:59,
                 from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/initializer_list:99:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::end(initializer_list<_Tp>)'
   99 |     end(initializer_list<_Tp> __ils) noexcept
      |     ^~~
/usr/include/c++/14/initializer_list:99:5: note:   candidate expects 1 argument, 0 provided
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/range_access.h:74:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&)'
   74 |     end(_Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/bits/range_access.h:74:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:85:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&)'
   85 |     end(const _Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/bits/range_access.h:85:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:106:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::end(_Tp (&)[_Nm])'
  106 |     end(_Tp (&__arr)[_Nm]) noexcept
      |     ^~~
/usr/include/c++/14/bits/range_access.h:106:5: note:   candidate expects 1 argument, 0 provided
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166:
/usr/include/c++/14/valarray:1249:5: note: candidate: 'template<class _Tp> _Tp* std::end(valarray<_Tp>&)'
 1249 |     end(valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/valarray:1249:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/valarray:1265:5: note: candidate: 'template<class _Tp> const _Tp* std::end(const valarray<_Tp>&)'
 1265 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/valarray:1265:5: note:   candidate expects 1 argument, 0 provided
Language: C++

// SeeAlso: https://atcoder.jp/contests/abc120/tasks/abc120_b

#include <bits/stdc++.h>

using namespace std;

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

#define MAX 100000

typedef int _loop_int;
#define REP(i,n) for(int i = 0; i < n; i++)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define CHMIN(a,b) a=min((a),(b))
#define CHMAX(a,b) a=max((a),(b))

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

    int m = min(A,B);

    int counter=0;
    
    for(int i=w;i<=m;i++) {
        if((A%i)==0 && (B%i)==0) {
            counter++;
        }
        if(counter==K) {
            cout << i << endl;
            break;
        }
    }

    return 0;
}


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

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

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

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

#include <bits/stdc++.h>
#define fi first
#define se second
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define sort(a) sort((a).begin(),(a).end())
#define rev(a) reverse((a).begin(),(a).end())
using db = double;
using namespace std;
typedef long long ll;

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

int main() {
  int a, b, k;
  cin >> a >> b >> k;
  int A = max(a,b);
  int B = min(a,b);
  int gcd = gcd(A, B);
  int ans;
  int cnt = 0;
  for (int i = gcd; i >= 1; i--) {
    if (gcd % i == 0) cnt++;
    if (cnt == k) {
      ans = i;
      break;
    }
  }
  cout << ans << endl;

  // cout << gcd(12, 16) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:16: error: 'gcd' cannot be used as a function
   22 |   int gcd = gcd(A, B);
      |             ~~~^~~~~~
Language: C++

#include <bits/stdc++.h>
#define fi first
#define se second
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define sort(a) sort((a).begin(),(a).end())
#define rev(a) reverse((a).begin(),(a).end())
using db = double;
using namespace std;
typedef long long ll;

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

int main() {
  int a, b, k;
  cin >> a >> b >> k;
  int gcd = gcd(max(a,b), min(a,b));

  int ans;
  int cnt = 0;
  for (int i = gcd; i >= 1; i--) {
    if (gcd % i == 0) cnt++;
    if (cnt == k) {
      ans = i;
      break;
    }
  }
  cout << ans << endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:16: error: 'gcd' cannot be used as a function
   20 |   int gcd = gcd(max(a,b), min(a,b));
      |             ~~~^~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <queue>
#include <stack>
#include <stdlib.h>
using namespace std;
#define rep(i,n) for (int i = 0; i <n; i++) 
#include <math.h>
#include <bits/stdc++.h>
using namespace std;
 
using namespace std;
int main(){
    int a,b,k;std::cin >> a>>b>>k;
    int n=0;
    for(int i=0;i<min(a,b);i++){
        if(a%i==0&&b%i==0)n++
        if(n==k)std::cout << i << std::endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:30: error: expected ';' before 'if'
   23 |         if(a%i==0&&b%i==0)n++
      |                              ^
      |                              ;
   24 |         if(n==k)std::cout << i << std::endl;
      |         ~~
Language: Java

import java.util.Scanner;
class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int num1 = sc.nextInt();
        int num2 = sc.nextInt();
        int order = sc.nextInt();

        int div = 1;
        while(cnt < order){
            if(num1 % div == 0 && num2 % div == 0){
                cnt++;
            }
        }
        System.out.println(div);
    }
}

Compiler output:
Main.java:11: error: cannot find symbol
        while(cnt < order){
              ^
  symbol:   variable cnt
  location: class Main
Main.java:13: error: cannot find symbol
                cnt++;
                ^
  symbol:   variable cnt
  location: class Main
2 errors
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:9:26: error: expected ';' before 'i'
    9 |   for(int i = 1; i <= 100 i++){
      |                          ^~
      |                          ;
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:16:1: error: '別解として' does not name a type
   16 | 別解として
      | ^~~~~~~~~~
Language: C++

#include <iostream>
#include <vector>
 
using namespace std;
 
int main(void) {
  int A, B, K;
  cin >> A >> B >> K;
  vector<int> div;
  
  for(int i=100;i>=1;i++) {
    if(i%A == 0 && i%B == 0) {
      div.push_back(i);
    }
  }
}
#include <iostream>
#include <vector>
 
using namespace std;
 
int main(void) {
  int A, B, K;
  cin >> A >> B >> K;
  vector<int> div;
  
  for(int i=100;i>=1;i++) {
    if(i%A == 0 && i%B == 0) {
      div.push_back(i);
    }
  cout << div[K-1] << endl;
  }
}


Compiler output:
a.cc:22:5: error: redefinition of 'int main()'
   22 | int main(void) {
      |     ^~~~
a.cc:6:5: note: 'int main()' previously defined here
    6 | int main(void) {
      |     ^~~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main(void) {
  int A, B, K;
  cin >> A >> B >> K;
  vector<int> div
  
  for(int i=100;i>=1;i++) {
    if(i%A == 0 && i%B == 0) {
      div.push_back(i);
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: expected initializer before 'for'
   11 |   for(int i=100;i>=1;i++) {
      |   ^~~
a.cc:11:17: error: 'i' was not declared in this scope
   11 |   for(int i=100;i>=1;i++) {
      |                 ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: expected ';' before 'push_back'
   11 |     what push_back (i);
      |         ^~~~~~~~~~
      |         ;
Language: C++

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

int main(){
	int A, B, K,V;
  	cin >> A >> B >> K;
    if(A > B){
      V = A;
      A = B;
      A = V;
  
  	vector<int> sin;
  	int X = B;
  	int j = 0;
  	for(int i = 0; i < B + 1; i++, X--){
	if(A % X == 0 && B % X == 0){
    sin.at(j) = X;
      j++;
    }
    }
      K--;
      cout << sin[K] << endl;
return 0;
}
      


Compiler output:
a.cc: In function 'int main()':
a.cc:24:2: error: expected '}' at end of input
   24 | }
      |  ^
a.cc:4:11: 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;
  
  	vector<int> sin;
  	int X = B;
  	int j = 0;
  	for(int i = 0; i < B + 2; i++, X--){
	if(A / X == 0 && B / X == 0){
    sin[j] = X;
      j++
    }
    }
      K--;
      cout << sin[K] << endl;
return 0;
}
      


Compiler output:
a.cc: In function 'int main()':
a.cc:14:10: error: expected ';' before '}' token
   14 |       j++
      |          ^
      |          ;
   15 |     }
      |     ~
Language: C++

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

int main(){
	int A, B, K;
  	cin >> A >> B >> K;
  
  	vector<int> sin;
  	int X = B;
  	int j = 0;
  	for(int i = 0; i < B + 2; i++, X--){
	if(A / X == 0 && B / X == 0){
    sin[j] = X;
      j++
    }
    }
      K--;
      cout << sin[K] << endl;
return 0;
}
      


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

#include<iostream>
using namespace std;

int main(){
	int A, B, K;
  	cin >> A >> B >> K;
  
  	vector<int> sin;
  	int X = B;
  	int j = 0;
  	for(int i = 0; i < B + 2; i++, X--){
	if(A / X == 0 && B / X == 0){
    sin[j] = X;
      j++
    }
    }
      K--;
      cout << sin[K] << 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> sin;
      |         ^~~~~~
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> sin;
      |                ^~~
a.cc:13:5: error: 'sin' was not declared in this scope
   13 |     sin[j] = X;
      |     ^~~
a.cc:14:10: error: expected ';' before '}' token
   14 |       j++
      |          ^
      |          ;
   15 |     }
      |     ~     
a.cc:18:15: error: 'sin' was not declared in this scope
   18 |       cout << sin[K] << endl;
      |               ^~~
Language: C++

#include "pch.h"
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <functional>
#include <map>
#include <iomanip>
#include <math.h> 
#include <stack>
#include <queue>
#include <bitset>
#include <cstdlib>
#include <tuple>
#include <cctype>
#include <ctype.h>
#include <set>
#include <sstream>
#include <time.h>
#include <numeric>
using namespace std;
//#define int long long
#define rep(i,s,n) for(int i = s;i<n;i++)
#define repe(i,s,n) for(int i = s;i<=n;i++)
#define rrep(i,s,n) for(int i = (n)-1;i>=(s);i--)
#define all(v) (v).begin(),(v).end()
#define pb push_back
#define fi first
#define se second
#define chmin(a,b) a=min((a),(b))
#define chmax(a,b) a=max((a),(b))
#define l1 list[index]
#define l2 list[index - 1]
#define l3 list[index + 1]
#define iif(i,j) ((i<0 && j<0) || (i>0 && j>0)) ? true : false 
typedef long long ll;
typedef pair<int, int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
typedef pair<pint, int> P1;
typedef pair<int, pint> P2;
typedef pair<pint, pint> PP;
static const ll maxLL = (ll)1 << 62;
const ll MOD = 1000000007;
const ll INF = 1e18;
const double PI = 3.14159265359;
int ca[12] = { 31,28,31,30,31,30,31,31,30,31,30,31 };




signed main() {
	int a, b, k;

	cin >> a >> b >> k;

	int cnt = 0, ans;
	vector<int>list;

	for (int i = 1; i <=b; i++) {
		if (a%i == 0 && b%i == 0) {
			list.push_back(i);
			//cout << "i->" << i << endl;
			
		}
	}

	cout << list[list.size() - k] << endl;



	return 0;
}

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

#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector> 
using namespace std;

int main() {
	vector<int> vc;
	int a;
	int b;
	int k;
	scanf("%d%d%d", &a, &b, &k);

	int no = 0;

	int min = min(a,b);

	for (int i = 1; i <= min;i++) {
		if (a%i == 0 && b%i == 0) {
			vc.push_back(i);
		}
	}
	printf("%d", vc[vc.size()-k]);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:22: error: 'min' cannot be used as a function
   16 |         int min = min(a,b);
      |                   ~~~^~~~~
Language: C++

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

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

#include<iostream>
using namespace std;
int main(){
  
  int A=0;
  int B=0;
  int K=0;
  int d=0;
  int j=0:
  int s[100]={0};
  cin>>A>>B>>K;
  if(A<B){
    d=A;
    A=B;
    B=d;
  }
  for(int i=1;i<B/2+1;i++){
    if(A%i==0&&B%i==0){
      s[j]=i;
      j++;
    }
}
  cout<<s[K-1];

Compiler output:
a.cc: In function 'int main()':
a.cc:9:10: error: expected ',' or ';' before ':' token
    9 |   int j=0:
      |          ^
a.cc:19:7: error: 's' was not declared in this scope
   19 |       s[j]=i;
      |       ^
a.cc:23:9: error: 's' was not declared in this scope
   23 |   cout<<s[K-1];
      |         ^
a.cc:23:16: error: expected '}' at end of input
   23 |   cout<<s[K-1];
      |                ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#include<iostream>
using namespace std;

int main(){
  int A=0;
  int B=0;
  int K=0;
  int d=0;
  cin>>A>>B>>K;
  if(A<B){
    d=A;
    A=B;
    b=d;
  }
  for(int i=0;i<50;i++){
     if(A<B){
    d=A;
    A=B;
    b=d;
  }
    if(A%B==0){
      cout<<B;
      break;
    }
  }
}

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

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define forn(i, n) for (int i = 0; i < int(n); i++)
#define in insert
#define speed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
const int INF = 1e9 + 5;
int main(){
    int a, b;
    cin >>a >> b >> k
    int cnt = 0;
    for(int i = 1; i <= min(a,b); i++){
        if(a%i == 0 && b%i == 0){
            cnt++;
            if(cnt == k){ cout << i;
            break;
        }
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:21: error: 'k' was not declared in this scope
   14 |     cin >>a >> b >> k
      |                     ^
a.cc:18:13: error: 'cnt' was not declared in this scope; did you mean 'int'?
   18 |             cnt++;
      |             ^~~
      |             int
Language: C++

#include <iostream>

using namespace std;
int main(int argc, char *argv[]) {
	int a, b, k;
	cin >> a >> b >> k;
	
	vector<int> divs;
	for (int i = 1; i <= min(a, b); i++) {
		if (a % i == 0 && b % i == 0) {
			divs.push_back(i);
		}
	}
	
	cout << divs[divs.size() - k] << endl;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:8:9: error: 'vector' was not declared in this scope
    8 |         vector<int> divs;
      |         ^~~~~~
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 | 
a.cc:8:16: error: expected primary-expression before 'int'
    8 |         vector<int> divs;
      |                ^~~
a.cc:11:25: error: 'divs' was not declared in this scope; did you mean 'div'?
   11 |                         divs.push_back(i);
      |                         ^~~~
      |                         div
a.cc:15:17: error: 'divs' was not declared in this scope; did you mean 'div'?
   15 |         cout << divs[divs.size() - k] << endl;
      |                 ^~~~
      |                 div
Language: C++

clude <iostream>

using namespace std;

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

  cin >> A >> B >> K;

  int count = 0;
  for(int i = 100; i != 1; i--){
    if(A % i == 0 and B % i == 0) count++;
    if(count == K) cout << i;
  }
}

Compiler output:
a.cc:1:1: error: 'clude' does not name a type
    1 | clude <iostream>
      | ^~~~~
a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope
    8 |   cin >> A >> B >> K;
      |   ^~~
a.cc:13:20: error: 'cout' was not declared in this scope; did you mean 'count'?
   13 |     if(count == K) cout << i;
      |                    ^~~~
      |                    count
Language: C++

#include <iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: 'mul' was not declared in this scope
   11 |     if(A % mul == 0 && B % mul == 0){
      |            ^~~
Language: Java

import java.util.Scanner;

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

        int count = 0;
        int ans = 0;
        for (int i = 1; count < k; i++) {
            if (a % i == 0 && b % i == 0) {
                count++;
                if (count == k) {
                    ans = i;
                }
            }
        }
        System.out.println(ans);
    }
}


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