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

#include<stdio.h>

int main()
{
    int x,y;
    scanf("%d %d",&x,&y);
    int n;
    int k;
    float z,Z;
    if(x<y) {z=x;Z=y;}
    else {z=y;Z=x;}
    if(Z%2==0)
    float sz=Z*0.5;
    else
    float sz=Z*0.5+0.5;
    if(z<=sz)
    {
        for(n=z; n>=1 ;n--)
        {
            if(z%n==0)
                {if(Z%n==0) {k=n;break;}}
        }
     }
     else
     {
      for(n=sz; n>=1 ;n--)
            {
                if(z%n==0)
                    {if(Z%n==0) {k=n;break;}}
            }
     }
    
    printf("%d\n",k);
    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: invalid operands of types 'float' and 'int' to binary 'operator%'
   12 |     if(Z%2==0)
      |        ~^~
      |        | |
      |        | int
      |        float
a.cc:16:11: error: 'sz' was not declared in this scope; did you mean 'z'?
   16 |     if(z<=sz)
      |           ^~
      |           z
a.cc:20:17: error: invalid operands of types 'float' and 'int' to binary 'operator%'
   20 |             if(z%n==0)
      |                ~^~
      |                | |
      |                | int
      |                float
a.cc:21:22: error: invalid operands of types 'float' and 'int' to binary 'operator%'
   21 |                 {if(Z%n==0) {k=n;break;}}
      |                     ~^~
      |                     | |
      |                     | int
      |                     float
a.cc:28:21: error: invalid operands of types 'float' and 'int' to binary 'operator%'
   28 |                 if(z%n==0)
      |                    ~^~
      |                    | |
      |                    | int
      |                    float
a.cc:29:26: error: invalid operands of types 'float' and 'int' to binary 'operator%'
   29 |                     {if(Z%n==0) {k=n;break;}}
      |                         ~^~
      |                         | |
      |                         | int
      |                         float
Language: C++

#include<stdio.h>

int main()
{
    int x,y;
    scanf("%d %d",&x,&y);
    int n;
    int k;
    float z,Z;
    if(x<y) {z=x;Z=y;}
    else {z=y;Z=x;}
    int sz=Z/2;
    if(z<=sz)
    {
        for(n=z; n>=1 ;n--)
        {
            if(z%n==0)
                {if(Z%n==0) {k=n;break;}}
        }
     }
     else
     {
      for(n=sz; n>=1 ;n--)
            {
                if(z%n==0)
                    {if(Z%n==0) {k=n;break;}}
            }
     }
    
    printf("%d\n",k);
    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:17: error: invalid operands of types 'float' and 'int' to binary 'operator%'
   17 |             if(z%n==0)
      |                ~^~
      |                | |
      |                | int
      |                float
a.cc:18:22: error: invalid operands of types 'float' and 'int' to binary 'operator%'
   18 |                 {if(Z%n==0) {k=n;break;}}
      |                     ~^~
      |                     | |
      |                     | int
      |                     float
a.cc:25:21: error: invalid operands of types 'float' and 'int' to binary 'operator%'
   25 |                 if(z%n==0)
      |                    ~^~
      |                    | |
      |                    | int
      |                    float
a.cc:26:26: error: invalid operands of types 'float' and 'int' to binary 'operator%'
   26 |                     {if(Z%n==0) {k=n;break;}}
      |                         ~^~
      |                         | |
      |                         | int
      |                         float
Language: C++

#include<stdio.h>

int main()
{
    int x,y;
    scanf("%d %d",&x,&y);
    int n;
    int k;
    int z,Z;
    if(x<y) {z=x;Z=y;}
    else if(x=y) {printf("%d",x);break;} 
    else {z=y;Z=x;}
    int sz=Z/2+1;
    if(z<=sz)
    {
        for(n=z; n>=1 ;n--)
        {
            if(z%n==0)
                {if(Z%n==0) {k=n;break;}}
        }
     }
     else
     {
      for(n=sz; n>=1 ;n--)
            {
                if(z%n==0)
                    {if(Z%n==0) {k=n;break;}}
            }
     }
    
    printf("%d\n",k);
    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:34: error: break statement not within loop or switch
   11 |     else if(x=y) {printf("%d",x);break;}
      |                                  ^~~~~
Language: C++

#include<stdio.h>

int main()
{
    int x,y;
    scanf("%d %d",&x,&y);
    if(x==y) printf("%d\n",x);
    else
    {
        int z,Z,n,k;
        if(x<y) z=x,Z=y;
        else 
        {
            z=y,Z=x;
            int r;
            for(;;)
            {
                 r=Z%z;
                 if(r==0) break;
                 Z=z;
                 z=r;
             }
    printf("%d\n",z);
}

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

#include<stdio.h>

int main()
{
    int x,y;
    scanf("%d %d",&x,&y);
    if(x==y) printf("%d\n",x);
    else
    {
        int z,Z,n,k;
        if(x<y) z=x,Z=y;
        else 
        {
            z=y,Z=x;
            int r;
            for(;;)
            {
                 r=Z%z;
                 if(r==0) break;
                 Z=z;
                 z=r;
             }
         printf("%d\n",z);
         }
}

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

#include<stdio.h>

int main()
{
    int x,y;
    scanf("%d %d",&x,&y);
    if(x==y) printf("%d\n",x);
    else
    {
        int z,Z,n,k;
        if(x<y) z=x,Z=y;
        else 
        {
            z=y,Z=x;
            int r;
            for(;;)
            {
                 r=Z%z;
                 if(r==0) break;
                 Z=z;
                 z=r;
             }
         printf("%d\n",z);
         }
    return 0;
}

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

int gcd(int x, int y)
{
    if (x < y) {
        int tmp = x;
        x = y;
        y = tmp;
    }
    while (y > 0) {
        int r = x % y;
        x = y;
        y = r;
    }
    return x;
}

int main()
{
    int x, y;
    std::cin >> x >> y;
    int ans = gcd(x, y);
    std::cout << ans << std::endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:10: error: 'cin' is not a member of 'std'
   19 |     std::cin >> x >> y;
      |          ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | int gcd(int x, int y)
a.cc:21:10: error: 'cout' is not a member of 'std'
   21 |     std::cout << ans << std::endl;
      |          ^~~~
a.cc:21:10: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:21:30: error: 'endl' is not a member of 'std'
   21 |     std::cout << ans << std::endl;
      |                              ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | int gcd(int x, int y)
Language: C++

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

/**
 * vector<int>ar(3);
 * for(auto&e:ar){
 *     scanf("%d",&e);
 * }
 * sort(ar.begin(),ar.end())
 * int sum=accumulate(ar.begin(),ar.end(),0);
 ***/
int gcd(int a,int b){
    int tmp;
    if(a<b){
        tmp=a;
        a=b;
        b=tmp;
    }
    for(;;){
        if(a%b==0) break;
        tmp=a%b;
        a=b;
        b=tmp;
    }
    return b;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
using namespace std;

int main(){
  int n1,n2;
  vector<int> m1,m2;
  cin>>n1>>n2;
  int ans;
  if(n1<n2){
    int temp=n2;
    n2=n1;
    n1=temp;
  }
  int a=n1%n2;
  for(int i=2;i<a/2+1;i++){
    if(a%i==0){
      if(n2%i==0&&n2>i){
	ans=i;
      }
    }
  }
  cout<<ans<<endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector<int> m1,m2;
      |   ^~~~~~
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:6:10: error: expected primary-expression before 'int'
    6 |   vector<int> m1,m2;
      |          ^~~
Language: C++

import java.io.*;
import java.util.StringTokenizer;

class Main{

static final PrintWriter out=new PrintWriter(System.out);

public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null&&!line.isEmpty()){
StringTokenizer st=new StringTokenizer(line);
int a=Integer.parseInt(st.nextToken());
int b=Integer.parseInt(st.nextToken());
out.println(gcd(Math.max(a,b),Math.min(a,b)));
out.flush();
}
}

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

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.io.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.util.StringTokenizer;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:8: error: 'final' does not name a type
    6 | static final PrintWriter out=new PrintWriter(System.out);
      |        ^~~~~
a.cc:8:7: error: expected ':' before 'static'
    8 | public static void main(String[] args) throws IOException{
      |       ^~~~~~~
      |       :
a.cc:8:25: error: 'String' has not been declared
    8 | public static void main(String[] args) throws IOException{
      |                         ^~~~~~
a.cc:8:34: error: expected ',' or '...' before 'args'
    8 | public static void main(String[] args) throws IOException{
      |                                  ^~~~
a.cc:8:38: error: expected ';' at end of member declaration
    8 | public static void main(String[] args) throws IOException{
      |                                      ^
      |                                       ;
a.cc:8:40: error: 'throws' does not name a type
    8 | public static void main(String[] args) throws IOException{
      |                                        ^~~~~~
a.cc:20:8: error: expected ':' before 'static'
   20 | private static long gcd(int a,int b){
      |        ^~~~~~~
      |        :
a.cc:24:2: error: expected ';' after class definition
   24 | }
      |  ^
      |  ;
Language: C++

//
//  main.cpp
//  ALDS1_1-B
//
//  Created by Saicj on 2015/08/31.
//  Copyright (c) 2015??´ saicj. All rights reserved.
//

#include <iostream>
#include <vector>

int main() {
    
    int x, y;
    std::cin >> x >> y;
    
    std::vector<int> results;
    
    int count = 0;
    
    if (x > y) {
        count = y;
    }else{
        count = x;
    }
    
    for (int i = 1; i <= count; ++i) {
        
        if (x % i == 0 && y % i == 0) {
            
            results.push_back(i);
        }
    }
    
    std::sort(results.begin(), results.end());
    
//    for (auto & num : results){
//        printf("%d ", num);
//    }

    printf("%d\n", results.back());
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   35 |     std::sort(results.begin(), results.end());
      |          ^~~~
      |          qsort
Language: C++

#include <iostream>

int main(){
	int A=0;
	int B=0;
	
	int MAX=0;
	int OUT=0;
	
	if(A<B){
		MAX=B;
	}else{
		MAX=A;
	}
	
	
	cin >> A >> B ;
	for(int i=0;i<MAX;i++){
		if(A%i==0){
			if(B%i==0){
				OUT=i;
			}
		}
	}
	cout <<OUT;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   17 |         cin >> A >> B ;
      |         ^~~
      |         std::cin
In file included 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:25:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   25 |         cout <<OUT;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++


a = gets.chomp!
a = a.split()
for i in 0..1
	a[i] = a[i].to_i
end
if a[0] < a[1]
	x = a[0]
	a[0] = a[1]
	a[1] = x
end


i = 0
while a[i] % a[i+1] != 0
	a.push(a[i] % a[i+1])
	i += 1
end

puts a[-1]

Compiler output:
a.cc:4:10: error: too many decimal points in number
    4 | for i in 0..1
      |          ^~~~
a.cc:2:1: error: 'a' does not name a type
    2 | a = gets.chomp!
      | ^
Language: C++

#include<iostream>
using namespace std;

int main(){
	int c,d;
	cin>>c>>d;
	cout<<GCD(c,d);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:15: error: 'GCD' was not declared in this scope
    7 |         cout<<GCD(c,d);
      |               ^~~
Language: C++

#include<iostream>
using namespace std;

int main(){
	int c,d;
	cin>>c>>d;
	cout<<gcd(c,d);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:15: error: 'gcd' was not declared in this scope
    7 |         cout<<gcd(c,d);
      |               ^~~
Language: C++

#include<iostream>
using namespace std;
int c,d;main(){cin>>c>>d;cout<<__gcd(c,d)<<endl;return 0;}

Compiler output:
a.cc:3:9: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | int c,d;main(){cin>>c>>d;cout<<__gcd(c,d)<<endl;return 0;}
      |         ^~~~
a.cc: In function 'int main()':
a.cc:3:32: error: '__gcd' was not declared in this scope
    3 | int c,d;main(){cin>>c>>d;cout<<__gcd(c,d)<<endl;return 0;}
      |                                ^~~~~
Language: C++

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

int main() {
  int a, b;
  cin >> a >> b;
   
  (a > b) ? cout << gcd(a,b) : cout << gcd(b,a);
 
  cout << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope
    8 |   cin >> a >> b;
      |   ^~~
a.cc:10:13: error: 'cout' was not declared in this scope
   10 |   (a > b) ? cout << gcd(a,b) : cout << gcd(b,a);
      |             ^~~~
a.cc:12:11: error: 'endl' was not declared in this scope
   12 |   cout << endl;
      |           ^~~~
Language: C++

#include <bits/stdc++.h>

int gcd(int a,int b){
if(a == b) return a;
int temp = a-b;
if(temp < b) swap(temp,b);
return gcd(temp,b);
}


int main(){
int a,b;
std::cin >> a >> b;
if(a < b) swap(a,b);
std::cout << gcd(a,b); 
}

Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:6:14: error: 'swap' was not declared in this scope
    6 | if(temp < b) swap(temp,b);
      |              ^~~~
a.cc:6:14: note: suggested alternatives:
In file included from /usr/include/c++/14/regex:68,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
                 from a.cc:1:
/usr/include/c++/14/bits/regex.h:2230:5: note:   'std::__cxx11::swap'
 2230 |     swap(match_results<_Bi_iter, _Alloc>& __lhs,
      |     ^~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:61,
                 from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/move.h:226:5: note:   'std::swap'
  226 |     swap(_Tp& __a, _Tp& __b)
      |     ^~~~
/usr/include/c++/14/bits/move.h:226:5: note:   'std::swap'
In file included from /usr/include/c++/14/exception:166,
                 from /usr/include/c++/14/stdexcept:38,
                 from /usr/include/c++/14/system_error:43,
                 from /usr/include/c++/14/bits/ios_base.h:46,
                 from /usr/include/c++/14/streambuf:43,
                 from /usr/include/c++/14/bits/streambuf_iterator.h:35,
                 from /usr/include/c++/14/iterator:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54:
/usr/include/c++/14/bits/exception_ptr.h:229:5: note:   'std::__exception_ptr::swap'
  229 |     swap(exception_ptr& __lhs, exception_ptr& __rhs)
      |     ^~~~
In file included from /usr/include/c++/14/filesystem:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200:
/usr/include/c++/14/bits/fs_path.h:736:15: note:   'std::filesystem::__cxx11::swap'
  736 |   inline void swap(path& __lhs, path& __rhs) noexcept { __lhs.swap(__rhs); }
      |               ^~~~
a.cc: In function 'int main()':
a.cc:14:11: error: 'swap' was not declared in this scope
   14 | if(a < b) swap(a,b);
      |           ^~~~
a.cc:14:11: note: suggested alternatives:
/usr/include/c++/14/bits/regex.h:2230:5: note:   'std::__cxx11::swap'
 2230 |     swap(match_results<_Bi_iter, _Alloc>& __lhs,
      |     ^~~~
/usr/include/c++/14/bits/move.h:226:5: note:   'std::swap'
  226 |     swap(_Tp& __a, _Tp& __b)
      |     ^~~~
/usr/include/c++/14/bits/move.h:226:5: note:   'std::swap'
/usr/include/c++/14/bits/exception_ptr.h:229:5: note:   'std::__exception_ptr::swap'
  229 |     swap(exception_ptr& __lhs, exception_ptr& __rhs)
      |     ^~~~
/usr/include/c++/14/bits/fs_path.h:736:15: note:   'std::filesystem::__cxx11::swap'
  736 |   inline void swap(path& __lhs, path& __rhs) noexcept { __lhs.swap(__rhs); }
      |               ^~~~
Language: C++

#include <iostream>
using namespace std;


int main() {
    long x,y,p,;
    cin >> x >>y;
    if(x < y) swap(x,y);

    while(1){
        p = x % y;
        if (p == 0)break;
        swap (x,y);
        y = p;
    }
    cout << y << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:16: error: expected unqualified-id before ';' token
    6 |     long x,y,p,;
      |                ^
Language: C++

#include <iostream>
#include <algorithm> 

using namespace std;


int main() {
    long x,y,p,;
    cin >> x >>y;
    if(x < y) swap(x,y);

    while(1){
        p = x % y;
        if (p == 0)break;
        swap (x,y);
        y = p;
    }
    cout << y << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: expected unqualified-id before ';' token
    8 |     long x,y,p,;
      |                ^
Language: C++

#include <cstdio>
#include <iostream>
using namespace std;
int main()
{
	int x, y;
	cin >> x >> y;
	do
	{
		if(x>y)
		{
			x=x%y
		}
		else
		{
			y=y%x
		}
	}
	while(x!=y)
	cout << x;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:30: error: expected ';' before '}' token
   12 |                         x=x%y
      |                              ^
      |                              ;
   13 |                 }
      |                 ~             
a.cc:16:30: error: expected ';' before '}' token
   16 |                         y=y%x
      |                              ^
      |                              ;
   17 |                 }
      |                 ~             
a.cc:19:20: error: expected ';' before 'cout'
   19 |         while(x!=y)
      |                    ^
      |                    ;
   20 |         cout << x;
      |         ~~~~
Language: C++

  while(x=!y)
    if(x>y){
      x=x%y;
      if(x==0)x=x;
    }
    else{
      y=y%x;
      if(y==0)y=y;
    }

Compiler output:
a.cc:1:3: error: expected unqualified-id before 'while'
    1 |   while(x=!y)
      |   ^~~~~
a.cc:6:5: error: expected unqualified-id before 'else'
    6 |     else{
      |     ^~~~
Language: C++

#include <stdio.h>

int gcd(int x, int y) {

	if (y == 0) return x;
	if (x >= y) return gcd(y, x % y);
	else return gcd(x, y % x);
}

int main() {
	int x, y;
	scanf_s("%d %d", &x, &y);
	printf("%d\n", gcd(x, y));
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   12 |         scanf_s("%d %d", &x, &y);
      |         ^~~~~~~
      |         scanf
Language: C++

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

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

int main() {
int a,b;
cin >> a >> b;
cout << gcd(a,b) << endl;
return 0;
}

Compiler output:
a.cc:4:9: error: 'a' was not declared in this scope
    4 | int gcd(a,b) {
      |         ^
a.cc:4:11: error: 'b' was not declared in this scope
    4 | int gcd(a,b) {
      |           ^
a.cc:4:12: error: expression list treated as compound expression in initializer [-fpermissive]
    4 | int gcd(a,b) {
      |            ^
a.cc: In function 'int main()':
a.cc:12:9: error: reference to 'gcd' is ambiguous
   12 | cout << gcd(a,b) << endl;
      |         ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:58,
                 from a.cc:1:
/usr/include/c++/14/numeric:173:5: note: candidates are: 'template<class _Mn, class _Nn> constexpr std::common_type_t<_Mn, _Nn> std::gcd(_Mn, _Nn)'
  173 |     gcd(_Mn __m, _Nn __n) noexcept
      |     ^~~
a.cc:4:5: note:                 'int gcd'
    4 | int gcd(a,b) {
      |     ^~~
Language: C++

#include<stdio.h>
#include<iostream>
#include<algorithm>

using namespace std;

int main(){

int x,y;

cin>>x>>y;

int gcd=2;
while(int i=2;i<max(x,y);i++){

if(x%i==0 && y%i==0 && i<gcd){
gcd=i;
break;

}


}
cout<<gcd<<endl;

return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:14: error: expected ')' before ';' token
   14 | while(int i=2;i<max(x,y);i++){
      |      ~       ^
      |              )
a.cc:14:15: error: 'i' was not declared in this scope
   14 | while(int i=2;i<max(x,y);i++){
      |               ^
Language: C++

#include<stdio.h>
#include<iostream>
#include<algorithm>

using namespace std;

int main(){

int x,y;
int p=1;

cin>>x>>y;

while(1){

dx=x;
x=y;
y=dx%y;

if(y==0)break;


}


cout<<y<<endl;

return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:1: error: 'dx' was not declared in this scope; did you mean 'x'?
   16 | dx=x;
      | ^~
      | x
Language: C++

#include<stdio.h>
#include<iostream>

using namespace std;

int main(){

int x,y;
int p=1;

cin>>x>>y;

while(1){

dx=x;
x=y;
y=dx%y;

if(y==0)break;


}


cout<<y<<endl;

return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:1: error: 'dx' was not declared in this scope; did you mean 'x'?
   15 | dx=x;
      | ^~
      | x
Language: C++


int call(int,int);

int main(){
        int x,y;

        scanf("%d %d",&x,&y);

        printf("%d\n",call(x,y));

        return 0;
}

int call(int x,int y){
        if(x%y) return call(y,x%y);
        else return y;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'scanf' was not declared in this scope
    7 |         scanf("%d %d",&x,&y);
      |         ^~~~~
a.cc:9:9: error: 'printf' was not declared in this scope
    9 |         printf("%d\n",call(x,y));
      |         ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 |
Language: C++

#include <iostream>

int main() {

    int a, b, c;

    cin >> a >> b;

    while(1) {
        c = a % b;
        if(c == 0) {
            cout << b << endl;
            break;
        }
        else{
            a = b;
            b = c;  
        }
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |     cin >> a >> b;
      |     ^~~
      |     std::cin
In file included 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:12:13: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   12 |             cout << b << endl;
      |             ^~~~
      |             std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:12:26: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   12 |             cout << b << endl;
      |                          ^~~~
      |                          std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <stdio.h>

int main() {
   int a, b, c;
   scanf ("%d %d", &a, &b);
   if (a = b) {
      printf ("%d", a);
   } else if (a > b) {
      while (b > 0) {
         c = a % b;
         a = b;
         b = c;
      }
      printf ("%d", a);
   } else if (a < b) {
      while (a > 0) {
         c = b % a;
         b = a;
         a = c;
      }
      printf ("%d, b);
   }
   return 0;
}

Compiler output:
a.cc:21:15: warning: missing terminating " character
   21 |       printf ("%d, b);
      |               ^
a.cc:21:15: error: missing terminating " character
   21 |       printf ("%d, b);
      |               ^~~~~~~~
a.cc: In function 'int main()':
a.cc:22:4: error: expected primary-expression before '}' token
   22 |    }
      |    ^
Language: C++

#include <stdio.h>
#include <algorithm>

int main(void){
  int x, y;
  scanf("%d, %d\n", x, y);

  gcd(x, y){  
    if (x < y)
        swap(x, y)
    while (y > 0){
        r = x % y;
        x = y;
        y = r;
}
    return x;
}

printf("%d\n", x);

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'gcd' was not declared in this scope
    8 |   gcd(x, y){
      |   ^~~
a.cc:19:19: error: expected '}' at end of input
   19 | printf("%d\n", x);
      |                   ^
a.cc:4:15: note: to match this '{'
    4 | int main(void){
      |               ^
Language: C++

#include<stdio.h>

int main(){

	int a,b,lar,sma;

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

	if(a>=b){
		lar=a;
		sma=b;
	}else{
		lar=b;
		sma=a;
	}

	int ama=lar%sma;

	while(ama!=0){
		lar=sma;
		sma=ama:
	}

	printf("%d",&sma);

	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:24: error: expected ';' before ':' token
   21 |                 sma=ama:
      |                        ^
      |                        ;
Language: C++

#include <stdio.h>
#include <algorithm>

int main(void){
  int x, y;
  scanf("%d, %d\n", x, y);

  gcd(x, y){  
    if (x < y)
        swap(x, y);
    while (y > 0){
        r = x % y;
        x = y;
        y = r;
}
    return x;
}

printf("%d\n", x);

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'gcd' was not declared in this scope
    8 |   gcd(x, y){
      |   ^~~
a.cc:19:19: error: expected '}' at end of input
   19 | printf("%d\n", x);
      |                   ^
a.cc:4:15: note: to match this '{'
    4 | int main(void){
      |               ^
Language: C++

#include<stdio.h>

int main(){

	int a,b,lar,sma;

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

	if(a>=b){
		lar=a;
		sma=b;
	}else{
		lar=b;
		sma=a;
	}

	int ama=lar%sma;

	while(ama!=0){
		lar=sma;
		sma=ama:
	}

	printf("%d\n",&sma);

	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:24: error: expected ';' before ':' token
   21 |                 sma=ama:
      |                        ^
      |                        ;
Language: C++

#include <stdio.h>
#include <algorithm>

int main(void){
  int x, y;
  scanf("%d, %d\n", x, y);

  gcd(x, y){  
    if (x < y)
        swap(x, y);
    while (y > 0){
        r = x % y;
        x = y;
        y = r;

    return x;
}
}

printf("%d\n", x);

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'gcd' was not declared in this scope
    8 |   gcd(x, y){
      |   ^~~
a.cc:20:19: error: expected '}' at end of input
   20 | printf("%d\n", x);
      |                   ^
a.cc:4:15: note: to match this '{'
    4 | int main(void){
      |               ^
Language: C++

#include<stdio.h>

int main(){

	int a,b,lar,sma;

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

	if(a>=b){
		lar=a;
		sma=b;
	}elseif(b>a){
		lar=b;
		sma=a;
	}

	int ama=lar%sma;

	while(ama!=0){
		lar=sma;
		sma=ama:
	}

	printf("%d\n",&sma);

	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:10: error: 'elseif' was not declared in this scope
   12 |         }elseif(b>a){
      |          ^~~~~~
a.cc:21:24: error: expected ';' before ':' token
   21 |                 sma=ama:
      |                        ^
      |                        ;
Language: C++

#include <stdio.h>
int main()
{
int x, y, z, i;
scanf("%d %d",&x ,&y);
x= x % y;
for(i=1;i<=y;i++){
if(x % i == 0 && y % i ==0)
z=i;
printf("%d\n",z);
break;

return 0;
}

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

#include <stdio.h>
#include <algorithm>

int main(void){
  int x, y;
  scanf("%d, %d\n", x, y);

  gcd(x, y){  
    if (x < y)
        swap(x, y);
    while (y > 0){
        r = x % y;
        x = y;
        y = r;

    return x;
    }
  }

printf("%d\n", x);

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'gcd' was not declared in this scope
    8 |   gcd(x, y){
      |   ^~~
Language: C++

#include<stdio.h>

int main(){

	int a,b,lar,sma,ama;

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

	if(a>=b){
		lar=a;
		sma=b;
	}elseif(b>a){
		lar=b;
		sma=a;
	}



	while((ama=lar%sma)!=0){
		lar=sma;
		sma=ama:
	}

	printf("%d\n",&sma);

	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:10: error: 'elseif' was not declared in this scope
   12 |         }elseif(b>a){
      |          ^~~~~~
a.cc:21:24: error: expected ';' before ':' token
   21 |                 sma=ama:
      |                        ^
      |                        ;
Language: C++

#include<stdio.h>

int main(){

	int a,b,lar,sma,ama;

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

	if(a>=b){
		lar=a;
		sma=b;
	}else if(b>a){
		lar=b;
		sma=a;
	}



	while((ama=lar%sma)!=0){
		lar=sma;
		sma=ama:
	}

	printf("%d\n",&sma);

	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:24: error: expected ';' before ':' token
   21 |                 sma=ama:
      |                        ^
      |                        ;
Language: C++

#include<stdio.h>

int main(){

	int a,b,lar,sma,ama;

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

	if(a>=b){
		lar=a;
		sma=b;
	}else if(b>a){
		lar=b;
		sma=a;
	}



	while((ama=lar%sma)!=0){
		lar=sma;
		sma=ama:
	}

	printf("%d\n",&sma);



}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:24: error: expected ';' before ':' token
   21 |                 sma=ama:
      |                        ^
      |                        ;
Language: C++


#include <stdio.h> 

int main(void) 
{ 
   int x, y, r, tmp; 
   scanf("%d",&x)
   scanf("%d", &y); 

   if(a<b){
   tmp = x; 
   x = y ;
   y = tmp;
   }
    r=a%b;
   
   while(r!=0){ 
   x = y; 
   y = r; 
   r = x % y; 
   }

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:18: error: expected ';' before 'scanf'
    7 |    scanf("%d",&x)
      |                  ^
      |                  ;
    8 |    scanf("%d", &y);
      |    ~~~~~          
a.cc:10:7: error: 'a' was not declared in this scope
   10 |    if(a<b){
      |       ^
a.cc:10:9: error: 'b' was not declared in this scope
   10 |    if(a<b){
      |         ^
a.cc:15:7: error: 'a' was not declared in this scope
   15 |     r=a%b;
      |       ^
a.cc:15:9: error: 'b' was not declared in this scope
   15 |     r=a%b;
      |         ^
Language: C++


#include <stdio.h> 

int main(void) 
{ 
   int x, y, r, tmp; 
   scanf("%d",&x);
   scanf("%d", &y); 

   if(a<b){
   tmp = x; 
   x = y ;
   y = tmp;
   }
    r=a%b;
   
   while(r!=0){ 
   x = y; 
   y = r; 
   r = x % y; 
   }

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:7: error: 'a' was not declared in this scope
   10 |    if(a<b){
      |       ^
a.cc:10:9: error: 'b' was not declared in this scope
   10 |    if(a<b){
      |         ^
a.cc:15:7: error: 'a' was not declared in this scope
   15 |     r=a%b;
      |       ^
a.cc:15:9: error: 'b' was not declared in this scope
   15 |     r=a%b;
      |         ^
Language: C++

#include <stdio.h> 

int main(void) 
{ 
   int x, y, r, tmp; 
   scanf("%d",&x);
   scanf("%d",&y); 

   if(a<b){
   tmp = x; 
   x = y ;
   y = tmp;
   }
    r=a%b;
   
   while(r!=0){ 
   x = y; 
   y = r; 
   r = x % y; 
   }

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: 'a' was not declared in this scope
    9 |    if(a<b){
      |       ^
a.cc:9:9: error: 'b' was not declared in this scope
    9 |    if(a<b){
      |         ^
a.cc:14:7: error: 'a' was not declared in this scope
   14 |     r=a%b;
      |       ^
a.cc:14:9: error: 'b' was not declared in this scope
   14 |     r=a%b;
      |         ^
Language: C++

#include <stdio.h> 

int main(void) 
{ 
   int x, y, r, tmp; 
   scanf("%d",&x);
   scanf("%d",&y); 

   if(a<b){
   tmp = x; 
   x = y ;
   y = tmp;
   }
    r=x%y;
   
   while(r!=0){ 
   x = y; 
   y = r; 
   r = x % y; 
   }

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

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

#include <stdio.h>
#include <algorithm>

int main(void){
  int x, y, z;
  scanf("%d, %d\n", x, y);
  z = gcd(x, y);

  printf("%d\n", z);
 
return 0;
}

int gcd(x, y){  
    if (x < y)
        swap(x, y);
    while (y > 0){
        r = x % y;
        x = y;
        y = r;

    return x;
    }
}


return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: 'gcd' was not declared in this scope
    7 |   z = gcd(x, y);
      |       ^~~
a.cc: At global scope:
a.cc:14:9: error: 'x' was not declared in this scope
   14 | int gcd(x, y){
      |         ^
a.cc:14:12: error: 'y' was not declared in this scope
   14 | int gcd(x, y){
      |            ^
a.cc:14:13: error: expression list treated as compound expression in initializer [-fpermissive]
   14 | int gcd(x, y){
      |             ^
a.cc:27:1: error: expected unqualified-id before 'return'
   27 | return 0;
      | ^~~~~~
a.cc:28:1: error: expected declaration before '}' token
   28 | }
      | ^
Language: C++

#include <stdio.h>
#include <algorithm>

int main(void){
  int x, y, z;
  scanf("%d, %d\n", x, y);
  z = gcd(x, y);

  printf("%d\n", z);
 
return 0;
}

int gcd(x, y){
    int r;  
    if (x < y)
        swap(x, y);
    while (y > 0){
        r = x % y;
        x = y;
        y = r;

    return x;
    }
}


return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: 'gcd' was not declared in this scope
    7 |   z = gcd(x, y);
      |       ^~~
a.cc: At global scope:
a.cc:14:9: error: 'x' was not declared in this scope
   14 | int gcd(x, y){
      |         ^
a.cc:14:12: error: 'y' was not declared in this scope
   14 | int gcd(x, y){
      |            ^
a.cc:14:13: error: expression list treated as compound expression in initializer [-fpermissive]
   14 | int gcd(x, y){
      |             ^
a.cc:28:1: error: expected unqualified-id before 'return'
   28 | return 0;
      | ^~~~~~
a.cc:29:1: error: expected declaration before '}' token
   29 | }
      | ^
Language: C++

#include <stdio.h>
int main(void)
{
int x, y;
scanf("%d %d", &x, &y);
if(x > y){
while(y > 0){
        r = x % y
        x = y
        y = r
}
printf("%d\n", x);
}
if(y > x){
while(x > 0){
        r = y % x
        y = x
        x = r
}
printf("%d\n", x);
}


return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'r' was not declared in this scope
    8 |         r = x % y
      |         ^
a.cc:16:9: error: 'r' was not declared in this scope
   16 |         r = y % x
      |         ^
Language: C++

#include <stdio.h>
int main(void)
{
int x, y, r;
scanf("%d %d", &x, &y);
if(x > y){
while(y > 0){
        r = x % y
        x = y
        y = r
}
printf("%d\n", x);
}
if(y > x){
while(x > 0){
        r = y % x
        y = x
        x = r
}
printf("%d\n", x);
}


return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:18: error: expected ';' before 'x'
    8 |         r = x % y
      |                  ^
      |                  ;
    9 |         x = y
      |         ~         
a.cc:16:18: error: expected ';' before 'y'
   16 |         r = y % x
      |                  ^
      |                  ;
   17 |         y = x
      |         ~
Language: C++

#include <stdio.h>
#include <algorithm>

int main(void){
  int x, y, z;
  scanf("%d, %d\n", x, y);
  z = gcd(x, y);

  printf("%d\n", z);
 
return 0;
}

int gcd(x, y){
    int r;  
    if (x < y)
        swap(x, y);
    while (y > 0){
        r = x % y;
        x = y;
        y = r;
    }
    return x;
    
}


return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: 'gcd' was not declared in this scope
    7 |   z = gcd(x, y);
      |       ^~~
a.cc: At global scope:
a.cc:14:9: error: 'x' was not declared in this scope
   14 | int gcd(x, y){
      |         ^
a.cc:14:12: error: 'y' was not declared in this scope
   14 | int gcd(x, y){
      |            ^
a.cc:14:13: error: expression list treated as compound expression in initializer [-fpermissive]
   14 | int gcd(x, y){
      |             ^
a.cc:28:1: error: expected unqualified-id before 'return'
   28 | return 0;
      | ^~~~~~
a.cc:29:1: error: expected declaration before '}' token
   29 | }
      | ^
Language: C++

#include <stdio.h>
int main(void)
{
int x, y, r;
scanf("%d %d", &x, &y);
if(x > y){
while(y > 0){
        r = x % y
        x = y
        y = r
}
printf("%d\n", x);
}
if(y > x){
while(x > 0){
        r = y % x
        y = x
        x = r
}
printf("%d\n", y);
}

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:18: error: expected ';' before 'x'
    8 |         r = x % y
      |                  ^
      |                  ;
    9 |         x = y
      |         ~         
a.cc:16:18: error: expected ';' before 'y'
   16 |         r = y % x
      |                  ^
      |                  ;
   17 |         y = x
      |         ~
Language: C++

#include <stdio.h>
#include <algorithm>

int main(void){
  int x, y, z;
  scanf("%d, %d\n", x, y);
  z = gcd(x, y);

  printf("%d\n", z);
 
return 0;
}

int gcd(x, y){
    int r;  
    if (x < y)
        swap(x, y);
    while (y > 0){
        r = x % y;
        x = y;
        y = r;
    }
    return x;
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: 'gcd' was not declared in this scope
    7 |   z = gcd(x, y);
      |       ^~~
a.cc: At global scope:
a.cc:14:9: error: 'x' was not declared in this scope
   14 | int gcd(x, y){
      |         ^
a.cc:14:12: error: 'y' was not declared in this scope
   14 | int gcd(x, y){
      |            ^
a.cc:14:13: error: expression list treated as compound expression in initializer [-fpermissive]
   14 | int gcd(x, y){
      |             ^
Language: C++

#include <stdio.h>
#include <algorithm>

int gcd(int, int);

int main(){
  int x, y, z;
  scanf("%d, %d\n", x, y);
  z = gcd(x, y);

  printf("%d\n", z);
 
return 0;
}

int gcd(int x,int y){
    int r;  
    if (x < y)
        swap(x, y);
    while (y > 0){
        r = x % y;
        x = y;
        y = r;
    }
    return x;
    
}

Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:19:9: error: 'swap' was not declared in this scope
   19 |         swap(x, y);
      |         ^~~~
a.cc:19:9: note: suggested alternatives:
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_pair.h:1106:5: note:   'std::swap'
 1106 |     swap(pair<_T1, _T2>&, pair<_T1, _T2>&) = delete;
      |     ^~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:61:
/usr/include/c++/14/bits/move.h:226:5: note:   'std::swap'
  226 |     swap(_Tp& __a, _Tp& __b)
      |     ^~~~
/usr/include/c++/14/bits/move.h:226:5: note:   'std::swap'
Language: C++

#include <stdio.h>
#include <algorithm>

int gcd(int, int);

int main(){
  int x, y, z;
  scanf("%d %d", &x, &y);
  z = gcd(x, y);

  printf("%d\n", z);
 
return 0;
}

int gcd(int x,int y){
    int r;
    if (x > y)
     swap(x, y);  

    while (y > 0){
        r = x % y;
        x = y;
        y = r;
    }
    return x;
    
}

Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:19:6: error: 'swap' was not declared in this scope
   19 |      swap(x, y);
      |      ^~~~
a.cc:19:6: note: suggested alternatives:
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_pair.h:1106:5: note:   'std::swap'
 1106 |     swap(pair<_T1, _T2>&, pair<_T1, _T2>&) = delete;
      |     ^~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:61:
/usr/include/c++/14/bits/move.h:226:5: note:   'std::swap'
  226 |     swap(_Tp& __a, _Tp& __b)
      |     ^~~~
/usr/include/c++/14/bits/move.h:226:5: note:   'std::swap'
Language: C++

#include <stdio.h>
#include <algorithm>

int gcd(int, int);

int main(){
  int x, y, z;
  scanf("%d %d", &x, &y);
  z = gcd(x, y);

  printf("%d\n", z);
 
return 0;
}

int gcd(int x,int y){
    int r;
    if (x > y)
     swap(x, y)  

    while (y > 0){
        r = x % y;
        x = y;
        y = r;
    }
    return x;
    
}

Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:19:6: error: 'swap' was not declared in this scope
   19 |      swap(x, y)
      |      ^~~~
a.cc:19:6: note: suggested alternatives:
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_pair.h:1106:5: note:   'std::swap'
 1106 |     swap(pair<_T1, _T2>&, pair<_T1, _T2>&) = delete;
      |     ^~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:61:
/usr/include/c++/14/bits/move.h:226:5: note:   'std::swap'
  226 |     swap(_Tp& __a, _Tp& __b)
      |     ^~~~
/usr/include/c++/14/bits/move.h:226:5: note:   'std::swap'
Language: C++

#include <stdio.h>
#include <algorithm>

int gcd(int, int);

int main(){
  int x, y, z;
  scanf("%d %d", &x, &y);
  z = gcd(x, y);

  printf("%d\n", z);
 
return 0;
}

int gcd(int x,int y){
    int r;
    if (x < y)
     swap(x, y);  

    while (y > 0){
        r = x % y;
        x = y;
        y = r;
    }
    return x;
    
}

Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:19:6: error: 'swap' was not declared in this scope
   19 |      swap(x, y);
      |      ^~~~
a.cc:19:6: note: suggested alternatives:
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_pair.h:1106:5: note:   'std::swap'
 1106 |     swap(pair<_T1, _T2>&, pair<_T1, _T2>&) = delete;
      |     ^~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:61:
/usr/include/c++/14/bits/move.h:226:5: note:   'std::swap'
  226 |     swap(_Tp& __a, _Tp& __b)
      |     ^~~~
/usr/include/c++/14/bits/move.h:226:5: note:   'std::swap'
Language: C++

#include <stdio.h>
#include <algorithm>

int gcd(int, int);

int main(){
  int x, y, z;
  scanf("%d %d", &x, &y);
  z = gcd(x, y);

  printf("%d\n", z);
 
return 0;
}

int gcd( x, y){
    int r;      

    while (y > 0){
        r = x % y;
        x = y;
        y = r;
    }
    return x;
    
}

Compiler output:
a.cc:16:10: error: 'int gcd' redeclared as different kind of entity
   16 | int gcd( x, y){
      |          ^
a.cc:4:5: note: previous declaration 'int gcd(int, int)'
    4 | int gcd(int, int);
      |     ^~~
a.cc:16:10: error: 'x' was not declared in this scope
   16 | int gcd( x, y){
      |          ^
a.cc:16:13: error: 'y' was not declared in this scope
   16 | int gcd( x, y){
      |             ^
Language: C++

#include <stdio.h>
int main()
{
int x, y, z, i;
scanf("%d %d",&x ,&y);
if(x >= y){
x= x % y;
}
else{
z=x;
x=y % x;
y=z;
}


for(i=y;i>=1;i--){
if(x % i == 0 y % i == 0){

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

Compiler output:
a.cc: In function 'int main()':
a.cc:17:14: error: expected ')' before 'y'
   17 | if(x % i == 0 y % i == 0){
      |   ~          ^~
      |              )
Language: C++

#include <stdio.h>
int main()
{
int x, y, r, i;
scanf("%d %d",&x ,&y);
if(x >= y){
while0(r>0){
r= x % y;
x=r;
y=x;
}
else{
while(r>0){
r=y%x;
y=x;
x=r;
}

for(i=y;i>=1;i--){
if(x % i == 0 && y % i == 0){

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:1: error: 'while0' was not declared in this scope
    7 | while0(r>0){
      | ^~~~~~
a.cc:12:1: error: expected '}' before 'else'
   12 | else{
      | ^~~~
a.cc:6:11: note: to match this '{'
    6 | if(x >= y){
      |           ^
a.cc:27:2: error: expected '}' at end of input
   27 | }
      |  ^
a.cc:3:1: note: to match this '{'
    3 | {
      | ^
Language: C++

#include <stdio.h>
int main()
{
int x, y, r, i;
scanf("%d %d",&x ,&y);
if(x >= y){
while0(r>0){
r= x % y;
x=r;
y=x;
}
else{
while(r>0){
r=y%x;
y=x;
x=r;
}}

for(i=y;i>=1;i--){
if(x % i == 0 && y % i == 0){

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:1: error: 'while0' was not declared in this scope
    7 | while0(r>0){
      | ^~~~~~
a.cc:12:1: error: expected '}' before 'else'
   12 | else{
      | ^~~~
a.cc:6:11: note: to match this '{'
    6 | if(x >= y){
      |           ^
Language: C++

#include <stdio.h>
int main()
{
int x, y, r, i;
scanf("%d %d",&x ,&y);
if(x >= y){
while0(r>0){
r= x % y;
x=r;
y=x;
}}
else{
while(r>0){
r=y%x;
y=x;
x=r;
}}

for(i=y;i>=1;i--){
if(x % i == 0 && y % i == 0){

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:1: error: 'while0' was not declared in this scope
    7 | while0(r>0){
      | ^~~~~~
Language: C++

#include <stdio.h>

int main() {
 int a,b,gcd;

 scanf ("%d %d ", &a, &b);
 
 if (a >= b) {
 gcd = a % b;
}
 
 if (b >= a) {
 gcd = b % a;
 
 printf("%d\n", gcd);
 return 0;

}

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

include <stdio.h>

int main() {
 int a,b,gcd;

 scanf ("%d %d", &a, &b);
 
 if (a >= b) {
 gcd = a % b;
}
 
 if (b >= a) {
 gcd = b % a;
 
 printf("%d\n", gcd);
 return 0;

}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <stdio.h>
      | ^~~~~~~
Language: C++

#include <stdio.h>

int main() {
 int a,b,d,gcd;

 scanf ("%d %d", &a, &b);
 
 if (a >= b) {
 d = a % b;
  if (d % b = 0) {
   gcd = d;
}
  else {
   gcd = 1;
}
}
 
 if (b >= a) {
  d = b % a;
  if (d % a = 0) {
   gcd = d;
}
  else {
   gcd = 1;
}
}
 
 printf("%d\n", gcd);
 return 0;

}

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

#include <stdio.h>

int main() {
 int a,b,d,gcd;

 scanf ("%d %d", &a, &b);
 
 if (a >= b) {
 d = a % b;
  if (b % d = 0) {
   gcd = d;
}
  else {
   gcd = 1;
}
}
 
 if (b >= a) {
  d = b % a;
  if (a % d = 0) {
   gcd = d;
}
  else {
   gcd = 1;
}
}
 
 printf("%d\n", gcd);
 return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: lvalue required as left operand of assignment
   10 |   if (b % d = 0) {
      |       ~~^~~
a.cc:20:9: error: lvalue required as left operand of assignment
   20 |   if (a % d = 0) {
      |       ~~^~~