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

#include<stdio.h>
#include<math.h>
int main()

{
    long long a,b,g,l,m,n,t;

    while(scanf("%lld%lld,&a,&b")!=EOF);
    {
        m=a;
        n=b;

        if(a==0) g=b;

        else if(b==0)
            g=b;

        else
        
            {
                while(n!=0)
            }
        }

  return 0;
 }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:13: error: expected primary-expression before '}' token
   22 |             }
      |             ^
a.cc: At global scope:
a.cc:27:1: error: expected declaration before '}' token
   27 | }
      | ^
Language: C++

#include <iostream>
#include <stdio.h>
#include <cmath>
using namespace std;
int d(int n,int m)
{
    int t;
    while(m!=0)
    {
        if(n<m) {t=n;n=m;m=t;}
        t=m;
        m=n%m;
        n=t;
    }
    return n;
}
int main()
{
    int t,n,m;
    while( scanf("%d %d",&n,&m))
    {
        t=d(n,m);
        long long l=n/t*m;
        cout<<k<<" "<<l<<endl;
    }
    return 0;
}

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

// GCDandLCM.cpp : ??????????????? ??¢????????±????????§????????¨????????? ?????????????????????????????????
//

#include "stdafx.h"
#include <iostream>
#include <iomanip>
using namespace std;

double eucAlg(int a,int b);


int main(int argc, char* argv[])
{
	double a,b;	//??\??????
	double c, d;	//??????

	while(cin >> a >> b){

		c = eucAlg(a, b);

		d = a * b / c;
		cout << fixed << setprecision(0) << c << " " << d << endl;
	}
	return 0;
}

//??????????????????????????????
double eucAlg(
	int a,
	int b
	)
{
	double c;

	do
	{
		c = a % b;
		if(c == 0){
			break;
		}
		a = b;
		b = c;

	}while(1);

	return b;
}

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

import java.util.*;

class Main {
	public static int gcd(int a, int b) {
		return b == 0 ? a : gcd(b, a % b);
	}
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		while (scanner.hasNext()) {
			int a = scanner.nextInt();
			int b = scanner.nextInt();
			int g = gcd(a, b);
			System.out.println(g + " " + a / g * b);
		}
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:15: error: expected ':' before 'static'
    4 |         public static int gcd(int a, int b) {
      |               ^~~~~~~
      |               :
a.cc:7:15: error: expected ':' before 'static'
    7 |         public static void main(String[] args) {
      |               ^~~~~~~
      |               :
a.cc:7:33: error: 'String' has not been declared
    7 |         public static void main(String[] args) {
      |                                 ^~~~~~
a.cc:7:42: error: expected ',' or '...' before 'args'
    7 |         public static void main(String[] args) {
      |                                          ^~~~
a.cc:16:2: error: expected ';' after class definition
   16 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:8:17: error: 'Scanner' was not declared in this scope
    8 |                 Scanner scanner = new Scanner(System.in);
      |                 ^~~~~~~
a.cc:9:24: error: 'scanner' was not declared in this scope
    9 |                 while (scanner.hasNext()) {
      |                        ^~~~~~~
a.cc:13:25: error: 'System' was not declared in this scope
   13 |                         System.out.println(g + " " + a / g * b);
      |                         ^~~~~~
Language: C++

#include<iostream>
using namespace std;
int gcd(int a,int b){
    while(a>0&&b>0){
        if(a>b)
            a%=b;
        else
            b%=a;
    }
    if(a==0)
        return b;
    else
        return a;
}
int main(){
    int a,b;
    while(cin>>a>>b){
        int c=gcd(a,b);
        lcm=a*b/c;
        cout<<c<<" "<<lcm<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: 'lcm' was not declared in this scope
   19 |         lcm=a*b/c;
      |         ^~~
Language: C++

#include<iostream>
using namespace std;
int a,b;
int gcd(int x,int y){
    a=x;
    b=y;
    while(a>0&&b>0){
        if(a>b)
            a%=b;
        else
            b%=a;
    }
    if(a==0)
        return b;
    else if(b==0)
        return a;
}
int main(){
   
    while(cin>>x>>y){
        int c=gcd(x,y);
        int lcm=(x*y)/c;
        cout<<c<<" "<<lcm<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:16: error: 'x' was not declared in this scope
   20 |     while(cin>>x>>y){
      |                ^
a.cc:20:19: error: 'y' was not declared in this scope
   20 |     while(cin>>x>>y){
      |                   ^
a.cc: In function 'int gcd(int, int)':
a.cc:17:1: warning: control reaches end of non-void function [-Wreturn-type]
   17 | }
      | ^
Language: C++

#include<iostream>
#include<stdio.h>
using namespace std;
typedef __int64 ll;
ll gcd(ll a,ll b){
    return (b==0)?a:gcd(b,a%b);
}
ll lcm(ll a,ll b){
    return a/gcd(a,b)*b;
}
int main(){
    ll a,b;
    while(scanf("%I64d %I64d",&a,&b)!=EOF){
        cout<<gcd(a,b)<<" "<<lcm(a,b)<<endl;
    }
    return 0;
}

Compiler output:
a.cc:4:9: error: '__int64' does not name a type; did you mean '__int64_t'?
    4 | typedef __int64 ll;
      |         ^~~~~~~
      |         __int64_t
a.cc:5:1: error: 'll' does not name a type
    5 | ll gcd(ll a,ll b){
      | ^~
a.cc:8:1: error: 'll' does not name a type
    8 | ll lcm(ll a,ll b){
      | ^~
a.cc: In function 'int main()':
a.cc:12:5: error: 'll' was not declared in this scope
   12 |     ll a,b;
      |     ^~
a.cc:13:32: error: 'a' was not declared in this scope
   13 |     while(scanf("%I64d %I64d",&a,&b)!=EOF){
      |                                ^
a.cc:13:35: error: 'b' was not declared in this scope
   13 |     while(scanf("%I64d %I64d",&a,&b)!=EOF){
      |                                   ^
a.cc:14:15: error: 'gcd' was not declared in this scope
   14 |         cout<<gcd(a,b)<<" "<<lcm(a,b)<<endl;
      |               ^~~
a.cc:14:30: error: 'lcm' was not declared in this scope
   14 |         cout<<gcd(a,b)<<" "<<lcm(a,b)<<endl;
      |                              ^~~
Language: C++

#include <iostream>

using namespace std;

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

int lcm(int a, int b){
	return ((a/gcd(a,b)) *b);
}

int main(){
	int a, b;

	while(cin >> a >> b){
		cout << gcd(a,b) << " " << lem(a,b) << endl;
	}
}

Compiler output:
a.cc:5:14: error: expected ')' before ';' token
    5 | int gcd(int a; int b){
      |        ~     ^
      |              )
a.cc:5:21: error: expected initializer before ')' token
    5 | int gcd(int a; int b){
      |                     ^
a.cc: In function 'int lcm(int, int)':
a.cc:15:23: error: too many arguments to function 'int gcd(int)'
   15 |         return ((a/gcd(a,b)) *b);
      |                    ~~~^~~~~
a.cc:5:5: note: declared here
    5 | int gcd(int a; int b){
      |     ^~~
a.cc: In function 'int main()':
a.cc:22:28: error: too many arguments to function 'int gcd(int)'
   22 |                 cout << gcd(a,b) << " " << lem(a,b) << endl;
      |                         ~~~^~~~~
a.cc:5:5: note: declared here
    5 | int gcd(int a; int b){
      |     ^~~
a.cc:22:44: error: 'lem' was not declared in this scope; did you mean 'lcm'?
   22 |                 cout << gcd(a,b) << " " << lem(a,b) << endl;
      |                                            ^~~
      |                                            lcm
Language: C++

#include <iostream>

using namespace std;

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

int lcm(int a, int b){
	return ((a/gcd(a,b)) *b);
}

int main(){
	int a, b;

	while(cin >> a >> b){
		cout << gcd(a,b) << " " << lcm(a,b) << endl;
	}
}

Compiler output:
a.cc:5:14: error: expected ')' before ';' token
    5 | int gcd(int a; int b){
      |        ~     ^
      |              )
a.cc:5:21: error: expected initializer before ')' token
    5 | int gcd(int a; int b){
      |                     ^
a.cc: In function 'int lcm(int, int)':
a.cc:15:23: error: too many arguments to function 'int gcd(int)'
   15 |         return ((a/gcd(a,b)) *b);
      |                    ~~~^~~~~
a.cc:5:5: note: declared here
    5 | int gcd(int a; int b){
      |     ^~~
a.cc: In function 'int main()':
a.cc:22:28: error: too many arguments to function 'int gcd(int)'
   22 |                 cout << gcd(a,b) << " " << lcm(a,b) << endl;
      |                         ~~~^~~~~
a.cc:5:5: note: declared here
    5 | int gcd(int a; int b){
      |     ^~~
Language: C++

#include <math.h>
#include <algorithm>
#include <iomanip>
using namespace std;

int main(){
	long long int x, y;
	while (cin >> x >> y) {
		long long int a, b, c;
		a = max(x, y);
		b = min(x, y);
		c = a % b;
		while (c) {
			a = b;
			b = c;
			c = a % b;
		}
		cout << b << ' ' << x * y / b << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: 'cin' was not declared in this scope
    8 |         while (cin >> x >> y) {
      |                ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include <iomanip>
  +++ |+#include <iostream>
    4 | using namespace std;
a.cc:18:17: error: 'cout' was not declared in this scope
   18 |                 cout << b << ' ' << x * y / b << endl;
      |                 ^~~~
a.cc:18:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include<cstdio>
#include<iostream>
#include <algorithm>

using namespace std;

int main() {
	long a, b;
	while (cin >> a >> b) {

		cout << __gcd(a, b) << " " << a * b / gcd(a, b) << endl;
	}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:55: error: 'gcd' was not declared in this scope
   11 |                 cout << __gcd(a, b) << " " << a * b / gcd(a, b) << endl;
      |                                                       ^~~
Language: C++

#include<cstdio>
#include<iostream>
#include <algorithm>

using namespace std;

int main() {
	long int  a, b;
	while (cin >> a >> b) {
		cout << __gcd(a, b) << " " << a * b / gcd(a, b) << endl;
	}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:55: error: 'gcd' was not declared in this scope
   10 |                 cout << __gcd(a, b) << " " << a * b / gcd(a, b) << endl;
      |                                                       ^~~
Language: C++

#include<cstdio>
#include<iostream>
#include <algorithm>

using namespace std;

int main() {
	long int  a, b;
	while (cin >> a >> b) {
		cout << __gcd(a, b) << " " << a / gcd(a, b) * b << endl;

	}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:51: error: 'gcd' was not declared in this scope
   10 |                 cout << __gcd(a, b) << " " << a / gcd(a, b) * b << endl;
      |                                                   ^~~
Language: C++

using System;
using System.Linq;
public class Test {
	public static int gcd(int x, int y) {
		if(y == 0) return x;
		return gcd(y, x % y);
	}
	public static int lcm(int x, int y) {
		return x / gcd(x, y) * y;
	}
	public static void Main() {
		string buf;
		while(!string.IsNullOrEmpty(buf = Console.ReadLine())) {
			string[] sc = buf.Split();
			int a = int.Parse(sc[0]), b = int.Parse(sc[1]);
			Console.WriteLine(gcd(a, b) + " " + lcm(a, b));
		}
	}
}

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
    2 | using System.Linq;
      |       ^~~~~~
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Test {
      | ^~~~~~
Language: C++

#include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
 
int main() {
    int n, m;
    while (2 == scanf("%d%d", &n, &m)) {
        printf("%d %d\n", __gcd(n, m), n / __lcm(n, m));
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:44: error: '__lcm' was not declared in this scope
    9 |         printf("%d %d\n", __gcd(n, m), n / __lcm(n, m));
      |                                            ^~~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
    int a,b,x;
    long long c;
    cin >> a >> b;
    c=a*b;
    if(a>=b){
        x=a;
        a=b;
        b=x%b;
    }
    else if(a<b){
        b=a%b;
    }
    while(b>0){
        x=a;
        a=b;
        b=x%b;
    }
    cout << a << " " << c/a << endl;
    retern 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:5: error: 'retern' was not declared in this scope; did you mean 'extern'?
   22 |     retern 0;
      |     ^~~~~~
      |     extern
Language: C++

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

int main(){
	int a, b, min ,max, gcd, lcm;
	
	while(cin >> a >> b){
		
		min = min(a, b);
		max = max(a, b);
		
		for(int i = 0; i < min; i++){
			if(min % i == 0 && max % i == 0) gcd = i;
		}
		
		while(1){
			int i = 1;
			if( (max * i) % min == 0) {
				lcm = max *i;
				break;
			}
			else i++;
		}
		
		cout << gcd <<  " " << lcm << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:26: error: 'min' cannot be used as a function
   10 |                 min = min(a, b);
      |                       ~~~^~~~~~
a.cc:11:26: error: 'max' cannot be used as a function
   11 |                 max = max(a, b);
      |                       ~~~^~~~~~
a.cc:27:2: error: expected '}' at end of input
   27 | }
      |  ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

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

int main(){
	int a, b, min ,max, gcd, lcm;
	
	while(cin >> a >> b){
		
		min = min(a, b);
		max = max(a, b);
		
		for(int i = 0; i < min; i++){
			if(min % i == 0 && max % i == 0) gcd = i;
		}
		
		while(1){
			int i = 1;
			if( (max * i) % min == 0) {
				lcm = max *i;
				break;
			}
			else i++;
		}
		
		cout << gcd <<  " " << lcm << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:26: error: 'min' cannot be used as a function
   10 |                 min = min(a, b);
      |                       ~~~^~~~~~
a.cc:11:26: error: 'max' cannot be used as a function
   11 |                 max = max(a, b);
      |                       ~~~^~~~~~
a.cc:27:2: error: expected '}' at end of input
   27 | }
      |  ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

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

int main(){
	int a, b, min ,max, gcd, lcm;
	
	while(cin >> a >> b){
		
		min = min(a, b);
		max = max(a, b);
		
		for(int i = 0; i < min; i++){
			if(min % i == 0 && max % i == 0) gcd = i;
		}
		
		while(1){
			int i = 1;
			if( (max * i) % min == 0) {
				lcm = max *i;
				break;
			}
			else i++;
		}
	}	
		cout << gcd <<  " " << lcm << endl;
}

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

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

int main(){
	int a, b, min ,max, gcd, lcm;
	
	while(cin >> a >> b){
		
		min = min(a, b);
		max = max(a, b);
		
		for(int i = 0; i < min; i++){
			if(min % i == 0 && max % i == 0) gcd = i;
		}
		
		while(1){
			int i = 1;
			if( (max * i) % min == 0) {
				lcm = max *i;
				break;
			}
			else i++;
		}
	}	
		cout << gcd <<  " " << lcm << endl;
}

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

#include<iostream>
using namespace std;

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

    int max = max(a,b);
    int min = min(a,b);

    int gcd = 0, lcm = 0;

    for(int i = 0; i < min; i++){
        if(max % i == 0) 
          gcd = i;
    }
    
    int j = 1;

    while(1){
      if((max * j) % min == 0){ 
        lcm = max * j; break;
      }
      else{ 
        i++;
      }
    }
    
    cout << gcd << " " << lcm << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:18: error: 'max' cannot be used as a function
    8 |     int max = max(a,b);
      |               ~~~^~~~~
a.cc:9:18: error: 'min' cannot be used as a function
    9 |     int min = min(a,b);
      |               ~~~^~~~~
a.cc:25:9: error: 'i' was not declared in this scope
   25 |         i++;
      |         ^
Language: C++

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

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

    int max = max(a,b);
    int min = min(a,b);

    int gcd = 0, lcm = 0;

    for(int i = 0; i < min; i++){
        if(max % i == 0) 
          gcd = i;
    }
    
    int j = 1;

    while(1){
      if((max * j) % min == 0){ 
        lcm = max * j; break;
      }
      else{ 
        i++;
      }
    }
    
    cout << gcd << " " << lcm << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: 'max' cannot be used as a function
    9 |     int max = max(a,b);
      |               ~~~^~~~~
a.cc:10:18: error: 'min' cannot be used as a function
   10 |     int min = min(a,b);
      |               ~~~^~~~~
a.cc:26:9: error: 'i' was not declared in this scope
   26 |         i++;
      |         ^
Language: C++

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

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

    int max = max(a,b);
    int min = min(a,b);

    int gcd = 0, lcm = 0;

    for(int i = 0; i < min; i++){
        if(max % i == 0) 
          gcd = i;
    }
    
    int j = 1;

    while(1){
      if((max * j) % min == 0){ 
        lcm = max * j;
        break;
      }
      else{ 
        i++;
      }
    }
    
    cout << gcd << " " << lcm << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:18: error: 'max' cannot be used as a function
   10 |     int max = max(a,b);
      |               ~~~^~~~~
a.cc:11:18: error: 'min' cannot be used as a function
   11 |     int min = min(a,b);
      |               ~~~^~~~~
a.cc:28:9: error: 'i' was not declared in this scope
   28 |         i++;
      |         ^
Language: C++

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

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

    int max = max(a, b);
    int min = min(a, b);

    long gcd = 0, lcm = 0;

    for(int i = 0; i < min; i++){
        if(max % i == 0) 
          gcd = i;
    }
    
    int j = 1;

    while(1){
      if((max * j) % min == 0){ 
        lcm = max * j;
        break;
      }
      else{ 
        i++;
      }
    }
    
    cout << gcd << " " << lcm << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:18: error: 'max' cannot be used as a function
   10 |     int max = max(a, b);
      |               ~~~^~~~~~
a.cc:11:18: error: 'min' cannot be used as a function
   11 |     int min = min(a, b);
      |               ~~~^~~~~~
a.cc:28:9: error: 'i' was not declared in this scope
   28 |         i++;
      |         ^
Language: C++

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

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

    int max = max(a, b);
    int min = min(a, b);

    long gcd = 0, lcm = 0;

    for(int i = 0; i < min; i++){
        if(max % i == 0) 
          gcd = i;
    }
    
    int j = 1;

    while(1){
      if((max * j) % min == 0){ 
        lcm = max * j;
        break;
      }
      else{ 
        j++;
      }
    }
    
    cout << gcd << " " << lcm << endl;
  }
}

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

#include<iostream>
#include <cstdio>
#include <algorithm>

using namespace std;


int main() {

	int a, b, c=1, GCD, LCM , d,???e;

	while (cin >> a >> b) {
		d = a;
		e = b;
		while (c) {
			c = a % b;
			if (c == 0) {
				GCD = b;
				break;
			}
			else {
				a = b;
				b = c;
			}
		}
		d /= GCD;
		e /= GCD;
		LCM = d*e*GCD;

		cout << GCD << " " << LCM << endl;
		c = 1;
	}

	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:37: error: expected unqualified-id before '?' token
   10 |         int a, b, c=1, GCD, LCM , d,???e;
      |                                     ^
a.cc:14:17: error: 'e' was not declared in this scope
   14 |                 e = b;
      |                 ^
Language: C++

#include<stdio.h>
int main(){
  long a,b,m,l;
  while(scanf("%d %d",&a,%b)!=EOF){
    m = a%b;
    l = a*b;
    while(m){
      a = b;
      b = m;
      m = a%b;
    }
    printf("%d %d\n",b,l/b);
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:26: error: expected primary-expression before '%' token
    4 |   while(scanf("%d %d",&a,%b)!=EOF){
      |                          ^
Language: C++

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

int main(){
    double a,b;

    while(cin>>a>>b){
        cout<<gcd(a,b)<<" "<<a / gcd(a,b) * b <<endl;
    }
    return 0;
}

Compiler output:
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:58,
                 from a.cc:2:
/usr/include/c++/14/numeric: In instantiation of 'constexpr std::common_type_t<_Mn, _Nn> std::gcd(_Mn, _Nn) [with _Mn = double; _Nn = double; common_type_t<_Mn, _Nn> = double]':
a.cc:9:18:   required from here
    9 |         cout<<gcd(a,b)<<" "<<a / gcd(a,b) * b <<endl;
      |               ~~~^~~~~
/usr/include/c++/14/numeric:175:21: error: static assertion failed: std::gcd arguments must be integers
  175 |       static_assert(is_integral_v<_Mn> && is_integral_v<_Nn>,
      |                     ^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/numeric:175:21: note: 'std::is_integral_v<double>' evaluates to false
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
                 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/type_traits: In instantiation of 'struct std::make_unsigned<double>':
/usr/include/c++/14/type_traits:2076:11:   required by substitution of 'template<class _Tp> using std::make_unsigned_t = typename std::make_unsigned::type [with _Tp = double]'
 2076 |     using make_unsigned_t = typename make_unsigned<_Tp>::type;
      |           ^~~~~~~~~~~~~~~
/usr/include/c++/14/numeric:182:24:   required from 'constexpr std::common_type_t<_Mn, _Nn> std::gcd(_Mn, _Nn) [with _Mn = double; _Nn = double; common_type_t<_Mn, _Nn> = double]'
  182 |       return __detail::__gcd<make_unsigned_t<_Ct>>(__m2, __n2);
      |              ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:9:18:   required from here
    9 |         cout<<gcd(a,b)<<" "<<a / gcd(a,b) * b <<endl;
      |               ~~~^~~~~
/usr/include/c++/14/type_traits:1929:13: error: invalid use of incomplete type 'class std::__make_unsigned_selector<double, false, false>'
 1929 |     { using type = typename __make_unsigned_selector<_Tp>::__type; };
      |             ^~~~
/usr/include/c++/14/type_traits:1837:11: note: declaration of 'class std::__make_unsigned_selector<double, false, false>'
 1837 |     class __make_unsigned_selector;
      |           ^~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

int main(){
    double a,b;

    while(cin>>a>>b){
        cout<<__gcd(a,b)<<" "<<a / __gcd(a,b) * b <<endl;
    }
    return 0;
}

Compiler output:
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h: In instantiation of '_EuclideanRingElement std::__gcd(_EuclideanRingElement, _EuclideanRingElement) [with _EuclideanRingElement = double]':
a.cc:9:20:   required from here
    9 |         cout<<__gcd(a,b)<<" "<<a / __gcd(a,b) * b <<endl;
      |               ~~~~~^~~~~
/usr/include/c++/14/bits/stl_algo.h:1141:43: error: invalid operands of types 'double' and 'double' to binary 'operator%'
 1141 |           _EuclideanRingElement __t = __m % __n;
      |                                       ~~~~^~~~~
Language: C++

#include <iostream>
using namespace std;

int gcd(int x,int y){
  if(x%y==0) return n;
  else{
    int z=x%y
    return gcd(y,z);
  }
}

int main()
{
  int a,b;
  int g;
  long int l;
  cin >> a >> b;
  
  if(a>b) g=gcd(a,b);
  else if(a<b) g=gcd(b,a);
  else g=a;

  l=a*b/g;
  cout << g << " " << l << " " << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:5:21: error: 'n' was not declared in this scope
    5 |   if(x%y==0) return n;
      |                     ^
a.cc:8:5: error: expected ',' or ';' before 'return'
    8 |     return gcd(y,z);
      |     ^~~~~~
Language: C++

#include <iostream>
using namespace std;

int gcd(int x,int y){
  if(x%y==0) return y;
  else{
    int z=x%y
    return gcd(y,z);
  }
}

int main()
{
  int a,b;
  int g;
  long int l;
  cin >> a >> b;
  
  if(a>b) g=gcd(a,b);
  else if(a<b) g=gcd(b,a);
  else g=a;

  l=a*b/g;
  cout << g << " " << l << " " << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:8:5: error: expected ',' or ';' before 'return'
    8 |     return gcd(y,z);
      |     ^~~~~~
a.cc:7:9: warning: control reaches end of non-void function [-Wreturn-type]
    7 |     int z=x%y
      |         ^
Language: C++

#include <iostream>			//std::cout, std::cin
#include <string>			//std::string,std::to_string(C++11)
#include <vector>			//std::vector
#include <valarray>			//std::valarray
#include <algorithm>		//std::sort
#include <ctime>			//localtime_s
#include <cstdlib>			//abs
#include <cmath>			//abs,std::pow,sqrt,sin,cos,round,floor,ceil
#include <fstream>			//std::ifstream,std::ofstream
#include <iomanip>			//std::setprecision,std::setw,std::setfill
#include <random>			//std::random(C++11)
#include <numeric>			//std::accumulate
#include <functional>		//std::greater
#include <chrono>			//std::chrono(C++11)
#include <bitset>			//std::bitset
#include <queue>			//std::queue

const static double	de_PI	= 3.14159265358979323846;
const static int	de_MOD	= 1000000007;
const static int	de_MAX	= 999999999;

int Greatest_Common_Divisor(int a, int b) {

	while (a != 0 && b != 0) {
		if (a > b) {
			a = a - b;
		}
		else {
			b = b - a;
		}
	}
	return(a + b);
}

int main(void) {

	//std::ifstream in("123.txt");	std::cin.rdbuf(in.rdbuf());
	//std::ofstream ofs("456.csv");
	//std::chrono::system_clock::time_point t_st = std::chrono::system_clock::now();

	unsigned int a = 0, b = 0;
	std::vector<unsigned int> GCD, LCM;

	while (std::cin >> a) {
		std::cin >> b;
		GCD.push_back(Greatest_Common_Divisor(a, b));
		LCM.push_back(unsigned long long(a)*unsigned long long(b) / GCD.back());
	}

	for (int i = 0; i < GCD.size(); i++) {
		std::cout << GCD[i] << " " << LCM[i] << std::endl;
	}

	//std::chrono::system_clock::time_point t_ed = std::chrono::system_clock::now();
	//std::cout << std::chrono::duration_cast<std::chrono::milliseconds>(t_ed - t_st).count() << "ms" << std::endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:31: error: expected primary-expression before 'unsigned'
   47 |                 LCM.push_back(unsigned long long(a)*unsigned long long(b) / GCD.back());
      |                               ^~~~~~~~
Language: C++















































File Edit Options Buffers Tools C++ Help
const int MAX = (int)1e5 + 5;

template<typename T>
T gcd(T a, T b)
{
        T c;
        while (a != 0) {
                c = a; a = b%a;  b = c;
        }
        return b;
}

template<typename T>
T lcm(T m, T n)
{
        return ((m / gcd(m, n)) * n);
}

signed main() {
  ll a, b;
  while(cin >> a >> b) {
    cout << gcd(a,b) << " " << lcm(a,b) << endl;
  }
  return 0;
}

Compiler output:
a.cc:47:1: error: 'File' does not name a type
   47 | File Edit Options Buffers Tools C++ Help
      | ^~~~
a.cc: In function 'int main()':
a.cc:67:3: error: 'll' was not declared in this scope
   67 |   ll a, b;
      |   ^~
a.cc:68:9: error: 'cin' was not declared in this scope
   68 |   while(cin >> a >> b) {
      |         ^~~
a.cc:68:16: error: 'a' was not declared in this scope
   68 |   while(cin >> a >> b) {
      |                ^
a.cc:68:21: error: 'b' was not declared in this scope
   68 |   while(cin >> a >> b) {
      |                     ^
a.cc:69:5: error: 'cout' was not declared in this scope
   69 |     cout << gcd(a,b) << " " << lcm(a,b) << endl;
      |     ^~~~
a.cc:69:44: error: 'endl' was not declared in this scope
   69 |     cout << gcd(a,b) << " " << lcm(a,b) << endl;
      |                                            ^~~~
Language: C++

#include<stdio.h>
#include<string.h>

int GCD(int x,int y)
{
  if(y==0)
    return x;
  return GCD(y,x%y);
}

int LCM(int x,int y)
{
  return x * y / GCD(x,y);
}



int main(void)
{
  int a,b;
  while(scanf("%d %d",&a,&b) != EOF)
    {
      if(a<b){
	int k = b;
	b = a;
	a = k;
      }
      printf("%d %d\n",GCD(a,b),LCM(a,b));
    }
}
#include<stdio.h>
#include<string.h>

int GCD(int x,int y)
{
  if(y==0)
    return x;
  return GCD(y,x%y);
}

int LCM(int x,int y)
{
  return x * y / GCD(x,y);
}



int main(void)
{
  int a,b;
  while(scanf("%d %d",&a,&b) != EOF)
    {
      if(a<b){
	int k = b;
	b = a;
	a = k;
      }
      printf("%d %d\n",GCD(a,b),LCM(a,b));
    }
}

Compiler output:
a.cc:34:5: error: redefinition of 'int GCD(int, int)'
   34 | int GCD(int x,int y)
      |     ^~~
a.cc:4:5: note: 'int GCD(int, int)' previously defined here
    4 | int GCD(int x,int y)
      |     ^~~
a.cc:41:5: error: redefinition of 'int LCM(int, int)'
   41 | int LCM(int x,int y)
      |     ^~~
a.cc:11:5: note: 'int LCM(int, int)' previously defined here
   11 | int LCM(int x,int y)
      |     ^~~
a.cc:48:5: error: redefinition of 'int main()'
   48 | int main(void)
      |     ^~~~
a.cc:18:5: note: 'int main()' previously defined here
   18 | int main(void)
      |     ^~~~
Language: C++

#include<iostream>
using namespace std;
int GCD(int n,int m){
  if(n<m){
    int t;
    t = m;
    m = n;
    n = t;
  }
  int i;
  while(n%m != 0){
    i = n%m;
    n = m;
    m = i;
  }
  return m;
    
}
int main(){
  int n,m,i=0,a[50],b[50];
  while(cin >> n >> m){
    a[i] = GCD(n,m);
    b[i] = n*m/GCD(n,m);
    i++;
    n = 0;
    m = 0;
  }
  for(n=0;n<i+1;n++) cout << a[n] << " " << b[n] << endl;
???return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:1: error: expected primary-expression before '?' token
   29 | ???return 0;
      | ^
a.cc:29:2: error: expected primary-expression before '?' token
   29 | ???return 0;
      |  ^
a.cc:29:3: error: expected primary-expression before '?' token
   29 | ???return 0;
      |   ^
a.cc:29:4: error: expected primary-expression before 'return'
   29 | ???return 0;
      |    ^~~~~~
a.cc:29:4: error: expected ':' before 'return'
   29 | ???return 0;
      |    ^~~~~~
      |    :
a.cc:29:4: error: expected primary-expression before 'return'
   29 | ???return 0;
      |    ^~~~~~
a.cc:29:4: error: expected ':' before 'return'
   29 | ???return 0;
      |    ^~~~~~
      |    :
a.cc:29:4: error: expected primary-expression before 'return'
   29 | ???return 0;
      |    ^~~~~~
a.cc:29:4: error: expected ':' before 'return'
   29 | ???return 0;
      |    ^~~~~~
      |    :
a.cc:29:4: error: expected primary-expression before 'return'
   29 | ???return 0;
      |    ^~~~~~
Language: C++

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

int u(int a, int b);
int l(int a, int b);

int main(){
  int a, b;
  int gcd, lcm;
  
  while(scanf("%d", &a)!=EOF){
    scanf("%d", &b);
    gcd = u(a, b);
    lcd = l(a, b);
    std::cout << a << " " << b << std::endl;
  }
  
  return 0;
}

int u(int a, int b){
  while(a==1 || b==1){
    if(a>=b){
      a %= b;
    }else{
      b %= a;
    }
  }
  
  if(a==1) return b;
  else     return a;
}

int l(int a, int b){
  int i = 2;
  
  while(1){
    if(a%i==0){
      if(b%i==0) return i;
      else i++;
    }else{
      i++;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:5: error: 'lcd' was not declared in this scope; did you mean 'lcm'?
   15 |     lcd = l(a, b);
      |     ^~~
      |     lcm
Language: C++

#include <stdio.h>
#include <math.h>

int u(int a, int b);
int l(int a, int b);

int main(){
  int a, b;
  int gcd, lcm;
  
  while(scanf("%d", &a)!=EOF){
    scanf("%d", &b);
    //gcd = u(a, b);
  / lcm = l(a, b);
//printf("%d %d\n",gcd, lcm);
    //std::cout << gcd << " " << lcm << std::endl;
  }
  
  return 0;
}

int u(int a, int b){
  while(a==1 || b==1){
    if(a>=b){
      a = a % b;
    }else{
      b = b % a;
    }
  }
  
  if(a==1){return b;}
  else{return a;}
}

int l(int a, int b){
  int i = 2;
  
  while(1){
    if(a%i==0){
      if(b%i==0){return i;}
      else{i++;}
    }else{
      i++;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:3: error: expected primary-expression before '/' token
   14 |   / lcm = l(a, b);
      |   ^
Language: C++

#include <stdio.h>
#include <math.h>

int u(int a, int b);
int l(int a, int b, int gcd);

int main(){
  int a, b;
  int gcd, lcm;
  
  while(scanf("%d", &a)!=EOF){
    scanf("%d", &b);
    gcd = u(a, b);
    lcm = l(a, b, gcd);
    std::cout << gcd << " " << lcm << std::endl;
  }
  
  return 0;
}

int u(int a, int b){
  while(1){
    if(a==1) return b;
    else     return a;
    if(a>=b){
      a = a % b;
    }else{
      b = b % a;
    }
  }
  
}

int l(int a, int b, int gcd){
  return a*b/gcd;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:10: error: 'cout' is not a member of 'std'
   15 |     std::cout << gcd << " " << lcm << std::endl;
      |          ^~~~
a.cc:3:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include <math.h>
  +++ |+#include <iostream>
    3 | 
a.cc:15:44: error: 'endl' is not a member of 'std'
   15 |     std::cout << gcd << " " << lcm << std::endl;
      |                                            ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include <math.h>
  +++ |+#include <ostream>
    3 |
Language: C++

#include <stdio.h>
#include <math.h>

int u(int a, int b);
int l(int a, int b, int gcd);

int main(){
  int a, b;
  int gcd, lcm;
  
  while(scanf("%d", &a)!=EOF){
    scanf("%d", &b);
    gcd = u(a, b);
    lcm = l(a, b, gcd);
    std::cout << gcd << " " << lcm << std::endl;
  }
  
  return 0;
}

int u(int a, int b){
  while(1){
    if(a==1) return b;
    else     return a;
    if(a>=b){
      a = a % b;
    }else{
      b = b % a;
    }
  }
  
}

int l(int a, int b, int gcd){
  return a * b / gcd;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:10: error: 'cout' is not a member of 'std'
   15 |     std::cout << gcd << " " << lcm << std::endl;
      |          ^~~~
a.cc:3:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include <math.h>
  +++ |+#include <iostream>
    3 | 
a.cc:15:44: error: 'endl' is not a member of 'std'
   15 |     std::cout << gcd << " " << lcm << std::endl;
      |                                            ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include <math.h>
  +++ |+#include <ostream>
    3 |
Language: C++

#include <iostream>
using namespace std;

int main(){
	int a,b;
	while(cin >> a >> b){
		int gcd = a, lcm;
		while(a%gcd != 0 || b%gcd != 0) gcd--;
		lcm = (a\gcd)*(b\gcd)*gcd;
		cout << gcd <<" "<< lcm << endl;
	}
}

Compiler output:
a.cc:9:25: error: stray '\' in program
    9 |                 lcm = (a\gcd)*(b\gcd)*gcd;
      |                         ^
a.cc:9:33: error: stray '\' in program
    9 |                 lcm = (a\gcd)*(b\gcd)*gcd;
      |                                 ^
a.cc: In function 'int main()':
a.cc:9:25: error: expected ')' before 'gcd'
    9 |                 lcm = (a\gcd)*(b\gcd)*gcd;
      |                       ~ ^~~~
      |                         )
Language: C++

#include <iostream>
using namespace std;

int main(){
	int a,b;
	while(cin >> a >> b){
		int gcd = a, lcm;
		while(a%gcd != 0 || b%gcd != 0) gcd--;
		lcm = (a\gcd)*(b\gcd)*gcd;
		cout << gcd <<" "<< lcm << endl;
	}
	return 0;
}

Compiler output:
a.cc:9:25: error: stray '\' in program
    9 |                 lcm = (a\gcd)*(b\gcd)*gcd;
      |                         ^
a.cc:9:33: error: stray '\' in program
    9 |                 lcm = (a\gcd)*(b\gcd)*gcd;
      |                                 ^
a.cc: In function 'int main()':
a.cc:9:25: error: expected ')' before 'gcd'
    9 |                 lcm = (a\gcd)*(b\gcd)*gcd;
      |                       ~ ^~~~
      |                         )
Language: C++

#include<iostream>


long long gcd (long long a, b) {
  if(a < b) {
    int foo = a;
    a = b;
    b = foo;
  }

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

int main() {
  long long a ,b;

  while (scanf("%ld", &a) != EOF) {
    scanf("%ld", &b);
    long long g = gcd(a, b);
    printf("%ld %.3lf\n", g, a * b / g);

  }

  return 0;
}

Compiler output:
a.cc:4:29: error: 'b' has not been declared
    4 | long long gcd (long long a, b) {
      |                             ^
a.cc: In function 'long long int gcd(long long int, int)':
a.cc:5:10: error: 'b' was not declared in this scope
    5 |   if(a < b) {
      |          ^
a.cc:11:10: error: 'b' was not declared in this scope
   11 |   if(a % b == 0) {
      |          ^
Language: C++

#include<iostream>
#include<cstdio>

long long gcd (long long a, b) {
  if(a < b) {
    int foo = a;
    a = b;
    b = foo;
  }

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

int main() {
  long long a ,b;

  while (scanf("%ld", &a) != EOF) {
    scanf("%ld", &b);
    long long g = gcd(a, b);
    printf("%ld %.3lf\n", g, a * b / g);

  }

  return 0;
}

Compiler output:
a.cc:4:29: error: 'b' has not been declared
    4 | long long gcd (long long a, b) {
      |                             ^
a.cc: In function 'long long int gcd(long long int, int)':
a.cc:5:10: error: 'b' was not declared in this scope
    5 |   if(a < b) {
      |          ^
a.cc:11:10: error: 'b' was not declared in this scope
   11 |   if(a % b == 0) {
      |          ^
Language: C++

//
//  main.c
//  c
//
//  Created by ????????? on 2016/12/10.
//  Copyright ?? 2016??´ ?????????. All rights reserved.
//

#include <stdio.h>
#include "0005.h"
int main(){
    long long a, b, r, lcm, x, y;
    while (scanf("%lld %lld",&a,&b) != EOF) {
        x=a;
        y=b;
        for (;;) {
            r=x%y;
            if (r==0)
                break;
            x=y;
            y=r;
        }
        lcm=a*b/y;
        printf("%lld %lld\n",y,lcm);
    }

    return 0;
}

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

import sys
 
def gcd(inta, intb):
    large = max(inta, intb)
    small = min(inta,intb)
    mod = large % small
    if mod ==0:
        return small
    else:
        return gcd(small, mod) 
     
def lcm(inta, intb, intgcd):
    return (inta * intb // intgcd)
 
sets = sys.stdin.readlines()
for line in sets:
    a, b = map(int, line.split())
    c = gcd(a, b)
    print(c, lcm(a, b, c))

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

#include<iostream>
using namespace std;

int main(){
    unsigned int a,b,c;
    int g[50],l[50];
    int p;
    for(int i=0;i<50;i++;){
        cin>>a>>b;
        p=a*b;
        while(b!=0){
            c=b;
            b=a%b;
            a=c;
        }
        g[i]=a;
        l[i]=p/g[i];
    }
    for(int i=0;i<50;i++;){
        cout<<g[i]<<" "<<l[i]<<endl;
    }
    return(0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:25: error: expected ')' before ';' token
    8 |     for(int i=0;i<50;i++;){
      |        ~                ^
      |                         )
a.cc:8:26: error: expected primary-expression before ')' token
    8 |     for(int i=0;i<50;i++;){
      |                          ^
a.cc:19:25: error: expected ')' before ';' token
   19 |     for(int i=0;i<50;i++;){
      |        ~                ^
      |                         )
a.cc:19:26: error: expected primary-expression before ')' token
   19 |     for(int i=0;i<50;i++;){
      |                          ^
Language: C++

#include<iostream>
using namespace std;

int Gcd(int a,int b){
    int c,d;
    if(b>a){
        d=a;
        a=b;
        b=d;
    }
    while(b!=0){
        c=b;
        b=a%b;
        a=c;
    }
    int g=a;
    return(g);
}

int main(){
    int m,n;
    long p;
    int k;
    while(cin>>m>>n){
        p=m*n;
        k=Gcd(m,n);
        cout<<k<<" "<<p/k<<endl;
    }
}
}

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

#include<iostream>
using namespace std;
int main(){
int a,b;cin>>a>>b;cout<<__gcd(a,b)<<" "<<a/__gcd(a,b)*b<<endl;return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:25: error: '__gcd' was not declared in this scope
    4 | int a,b;cin>>a>>b;cout<<__gcd(a,b)<<" "<<a/__gcd(a,b)*b<<endl;return 0;
      |                         ^~~~~
Language: C++

// ConsoleApplication17.cpp : ??????????????? ??¢????????±????????§????????¨????????? ?????????????????????????????????
//

#include "stdafx.h"
#include "iostream"

using namespace std;

void keisann(int a, int b) {
	long long ac = a;
	long long bc = b;
	bool d = true;
	do {
		a = a%b;
		if (a == 0) {
			cout << b << " ";
			cout << (ac*bc) / b << endl;
			d = false;
			continue;
		}
		b = b%a;
		if (b == 0) {
			cout << a << " ";
			cout << (ac*bc) / a << endl;
			d = false;
			continue;
		}
	} while (d == true);
}

int main()
{
	int a, b;
	while (cin >> a, a != EOF) {
		cin >> b;
		if (a > b) { keisann(a, b); }
		else if (a < b) {
			int c = a;
			a = b;
			b = c;
			keisann(a, b);
		}
		else if (a == b) {
			cout << a << " " << a << endl;
		}
	}
	return 0;
}

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


#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

using namespace std;
int main()
{
	long long a, b;
	while (cin >> a >> b)
	{
		int A, B;
		A = saisho(a,b);
		B = saidai(a, b);
		cout << A << " " << B<<endl;
	}
	return 0;

}
int saidai(int N, int M)
{
	int n = N, m = M;

	int s = 1;
	while (true)
	{
		if ((s*n) % m == 0)
		{
			break;
		}
		else { s++; }
	}
	return s*n;
}

int saisho(int N, int M)
{
	int n = N, m = M;
	while (true)
	{
		if (n == 0) { return m; break; }
		if (m == 0) { return n; break; }
		if (n > m) { n -= m; }
		else { m -= n; }
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:21: error: 'saisho' was not declared in this scope
   31 |                 A = saisho(a,b);
      |                     ^~~~~~
a.cc:32:21: error: 'saidai' was not declared in this scope
   32 |                 B = saidai(a, b);
      |                     ^~~~~~
Language: C++

#include<iostream>
using namespace std;

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

int main(){
	
	while(true){
		int a,b;
		cin >> a >> b;
		
		if(cin.eof()) break;
		
		int g = gcd(a,b);
		cout << g << ' ' << a/g*b << endl;
		
	}
	
	return 0;
	
}

Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:7:24: error: 'd' was not declared in this scope
    7 |         return gcd(b,a%d);
      |                        ^
Language: C++

#include <iostream>
using namespace std;

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

int main(){
	while(true){
		int a,b;
		cin>>a>>b;
		
		if(cin.eof())
			break;
			
		int g=gcd(a,b);
		cout<<g<<' '<<a/g*b<<endl;
	}
	return 0;
}					

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

#include <iostream>
using namespace std;

int gcd(int x,int y);

int main(){
   while(true){
      int a,b;
      cin >> a >> b;
      if(cin.eof())
         break;
      int c=gcd(a,b);
      cout << ' ' << a/c*b << endl;
   }
   return 0;
}

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

Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:19:7: error: 'b' was not declared in this scope
   19 |    if(b==0)
      |       ^
a.cc:21:15: error: 'b' was not declared in this scope
   21 |    return gcd(b,a%b);
      |               ^
a.cc:21:17: error: 'a' was not declared in this scope
   21 |    return gcd(b,a%b);
      |                 ^
Language: C++

include <iostream>
int GCD(int a, int b) {
 while (b!=0) {
  int r = a%b;
  a = b;
  b = r;
 }
 return a;
}
int main() {
 int a,b;
 while (std::cin>>a>>b) {
  int gcd = GCD(a,b);
  int lcm = a*b/gcd;
  std::cout << gcd << ' ' << lcm << std::endl;
 }
 return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:12:14: error: 'cin' is not a member of 'std'
   12 |  while (std::cin>>a>>b) {
      |              ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | include <iostream>
a.cc:13:13: error: 'GCD' was not declared in this scope
   13 |   int gcd = GCD(a,b);
      |             ^~~
a.cc:15:8: error: 'cout' is not a member of 'std'
   15 |   std::cout << gcd << ' ' << lcm << std::endl;
      |        ^~~~
a.cc:15:8: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:15:42: error: 'endl' is not a member of 'std'
   15 |   std::cout << gcd << ' ' << lcm << 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 | include <iostream>
Language: C++

#include <iostream>
int GCD(int a, int b) {
	while (b != 0) {
		int r = a%b;
		a = b;
		b = r;
	}
	return a;
}
int main() {
	int a, b;
	while (std::cin >> a >> b) {
		int gcd = GCD(a, b);
		int lcm = round((double)a/gcd*b);
		std::cout << gcd << ' ' << lcm << std::endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:27: error: 'round' was not declared in this scope
   14 |                 int lcm = round((double)a/gcd*b);
      |                           ^~~~~