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

#include <iostream>
using namespace std;

 using namespace std;
 int gcd(int a, int b)
{
    
}



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


Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:8:1: warning: no return statement in function returning non-void [-Wreturn-type]
    8 | }
      | ^
a.cc: In function 'int main()':
a.cc:17:28: error: invalid operands of types 'const char [2]' and 'int' to binary 'operator<<'
   17 |      cout << gcd(a,b) <" " << lcm << endl;
      |                        ~~~ ^~ ~~~
      |                        |      |
      |                        |      int
      |                        const char [2]
Language: C++

#include <stdio.h>
using namespace std;

int gcd(int num1,int num2) {
	if (num2 == 0) {
		return num1;
	}return gcd(num2, num1 % num2);
}

int lcm(int num1,int num2) {
	return num1 / gcd(num1, num2) * num2;
}

int main() {
	long a, b;
	while (scanf_s("%d %d",&a,&b)!=EOF) {
		printf("%d %d\n", gcd(a, b),lcm(a,b));
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   16 |         while (scanf_s("%d %d",&a,&b)!=EOF) {
      |                ^~~~~~~
      |                scanf
Language: C++

#include <stdio.h>
using namespace std;

int gcd(unsigned long num1,unsigned long num2) {
	if (num2 == 0) {
		return num1;
	}return gcd(num2, num1 % num2);
}

int lcm(unsigned long n1, unsigned long n2) {
	return n1 * n2 / gcd(n1, n2);
}

int main() {
	unsigned long a, b;
	while (~scanf_s("%d %d",&a,&b)) {
		printf("%d %d\n", gcd(a, b),lcm(a,b));
	}
}


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

using namespace std;

// GCD
template<class T> inline T gcd(T a, T b) {
    return (a == b) ? a : gcd(b % a, a);
}

// LCM
template<class T> inline T lcm(T a, T b) {
    return (a / gcd(a, b)) * b;
}

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


Compiler output:
a.cc: In function 'int main()':
a.cc:15:12: error: 'cin' was not declared in this scope
   15 |     while (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 | using namespace std;
a.cc:16:9: error: 'cout' was not declared in this scope
   16 |         cout << gcd(a, b) << " " << lcm(a, b) << endl;
      |         ^~~~
a.cc:16:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:16:50: error: 'endl' was not declared in this scope
   16 |         cout << gcd(a, b) << " " << lcm(a, b) << endl;
      |                                                  ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C++

#include <iostream>
using namespace std;

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

 GCD(b, a%b);
}

Compiler output:
a.cc: In function 'int GCD(int, int)':
a.cc:9:5: warning: control reaches end of non-void function [-Wreturn-type]
    9 |  GCD(b, a%b);
      |  ~~~^~~~~~~~
/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<stdio.h>
#include<math.h>
#include<algorithm>
using namespace std;
long long int a, b;
long long int gcd()
{
	long long int min = a,other=b;
	if (b < a){
		min = b; other = a;
	}
	int i;
	for (i = 1; i <= sqrt(long double(min)); i++)
	{
		if (min%i == 0)
		{
			if (other % (min / i) == 0)
				return min / i;
		
		}
	}
	for (i = sqrt(long double(min)); i >= 1; i--)
	{
		if (min%i == 0)
		{
			if (other %  i == 0)
				return i;
	     }
		
	}
}
int main()
{
	while (scanf("%lld %lld",&a,&b)==2)
	{
		long long int g = gcd();
		printf("%lld ", g);
		printf("%lld\n", (a / g)*(b / g)*g);
	}
}

Compiler output:
a.cc: In function 'long long int gcd()':
a.cc:13:31: error: expected primary-expression before 'long'
   13 |         for (i = 1; i <= sqrt(long double(min)); i++)
      |                               ^~~~
a.cc:22:23: error: expected primary-expression before 'long'
   22 |         for (i = sqrt(long double(min)); i >= 1; i--)
      |                       ^~~~
a.cc:31:1: warning: control reaches end of non-void function [-Wreturn-type]
   31 | }
      | ^
Language: C++

#include<stdio.h>
#include<math.h>
#include<algorithm>
using namespace std;
long long int a, b;
long long int gcd()
{
	long long int min = a,other=b;
	if (b < a){
		min = b; other = a;
	}
	long long int i;
	for (i = 1; i <= sqrt(long double(min)); i++)
	{
		if (min%i == 0)
		{
			if (other % (min / i) == 0)
				return min / i;
		
		}
	}
	for (i = sqrt(long double(min)); i >= 1; i--)
	{
		if (min%i == 0)
		{
			if (other %  i == 0)
				return i;
	     }
		
	}
}
int main()
{
	while (scanf("%lld %lld",&a,&b)==2)
	{
		long long int g = gcd();
		printf("%lld ", g);
		printf("%lld\n", (a / g)*(b / g)*g);
	}
}

Compiler output:
a.cc: In function 'long long int gcd()':
a.cc:13:31: error: expected primary-expression before 'long'
   13 |         for (i = 1; i <= sqrt(long double(min)); i++)
      |                               ^~~~
a.cc:22:23: error: expected primary-expression before 'long'
   22 |         for (i = sqrt(long double(min)); i >= 1; i--)
      |                       ^~~~
a.cc:31:1: warning: control reaches end of non-void function [-Wreturn-type]
   31 | }
      | ^
Language: C++

#include <cstdio>
#include <algorithm>

int main()
{
	int x, y;
	while (~scanf("%d%d", &x, &y)){
		int gcd = __gcd(x, y);
		printf("%d %d\n", gcd, x / gcd * y);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:27: error: '__gcd' was not declared in this scope; did you mean 'std::__gcd'?
    8 |                 int gcd = __gcd(x, y);
      |                           ^~~~~
      |                           std::__gcd
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:1137:5: note: 'std::__gcd' declared here
 1137 |     __gcd(_EuclideanRingElement __m, _EuclideanRingElement __n)
      |     ^~~~~
Language: C++

#include<stdio.h>
a;main(b){while(scanf("%d%d",&a,&b))printf("%d %d\n",a,b);
}

Compiler output:
a.cc:2:1: error: 'a' does not name a type
    2 | a;main(b){while(scanf("%d%d",&a,&b))printf("%d %d\n",a,b);
      | ^
a.cc:2:7: error: expected constructor, destructor, or type conversion before '(' token
    2 | a;main(b){while(scanf("%d%d",&a,&b))printf("%d %d\n",a,b);
      |       ^
Language: C++

#include<stdio.h>
main(a,b){while(scanf("%d%d",&a,&b))printf("%d %d\n",__gcd(a,b),__gcd(a,b)*b);
}

Compiler output:
a.cc:2:5: error: expected constructor, destructor, or type conversion before '(' token
    2 | main(a,b){while(scanf("%d%d",&a,&b))printf("%d %d\n",__gcd(a,b),__gcd(a,b)*b);
      |     ^
Language: C++

#include<stdio.h>
int main(){int a,b;while(scanf("%d%d",&a,&b))printf("%d %d\n",__gcd(a,b),__gcd(a,b)*b);return 0;}
 

Compiler output:
a.cc: In function 'int main()':
a.cc:2:63: error: '__gcd' was not declared in this scope; did you mean '__gid_t'?
    2 | int main(){int a,b;while(scanf("%d%d",&a,&b))printf("%d %d\n",__gcd(a,b),__gcd(a,b)*b);return 0;}
      |                                                               ^~~~~
      |                                                               __gid_t
Language: C++

#include<cstdio>
#include<algorithm>
int main(){int a,b;while(2=scanf("%d%d",&a,&b))printf("%d %d\n",std::__gcd(a,b),std::__gcd(a,b)*b);return 0;}
 

Compiler output:
a.cc: In function 'int main()':
a.cc:3:26: error: lvalue required as left operand of assignment
    3 | int main(){int a,b;while(2=scanf("%d%d",&a,&b))printf("%d %d\n",std::__gcd(a,b),std::__gcd(a,b)*b);return 0;}
      |                          ^
Language: C++

#include <iostream>
using namespace std;

int gcd(int a, int b){
  //a < b ユークリッドの互除法
  if(a==0) return b;
  return gcd(b%a,a)
}

//lcm = a*b/gcd
int main(){
  int a,b;
  while(cin >> a >> b){
    int g = gcd(a,b);
    cout << g << " " << a*b/g;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:7:20: error: expected ';' before '}' token
    7 |   return gcd(b%a,a)
      |                    ^
      |                    ;
    8 | }
      | ~
Language: C++

#include<iostream>
#include<algorithm>
#include<cstdio>
using namespace std;
int main(){
	long long a,b,s,m,ta,tb,tmp;
	while(cin>>a>>b){
	ta=a,tb=b;
	s=0,m=0;
	if(a<b)swap(a,b);
	
	else 
	while(true){
		if(a==0||b==0)cout<<"a#";
		tmp=a;
		a=b;
		b=tmp%a;
		if(a%b==0){
			m=b;
			break;
		}
		if(a<b){
		//cout<<a<<" "<<b<<endl;
		m=1;
		break;
		}
		s=(ta*tb)/m;
		cout<<m<<" "<<s<<endl;
	}
}

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

#include<iostream>
#include<algorithm>
using namespace std;
#define long long ll;
int main(){
ll  a,b,ta,tb;
	
	while(cin>>a>>b){
	ta=a;tb=b;
	if(a<b)swap(a,b);
	while(1){
		ll tmp=b;
		b=a%b;
		a=tmp;
		//cout<<a<<b<<endl;
		if(b==0)break;
	}
	cout<<a<<" "<<ta*tb/a<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:1: error: 'll' was not declared in this scope
    6 | ll  a,b,ta,tb;
      | ^~
a.cc:8:20: error: 'a' was not declared in this scope
    8 |         while(cin>>a>>b){
      |                    ^
a.cc:8:23: error: 'b' was not declared in this scope
    8 |         while(cin>>a>>b){
      |                       ^
a.cc:9:9: error: 'ta' was not declared in this scope; did you mean 'tm'?
    9 |         ta=a;tb=b;
      |         ^~
      |         tm
a.cc:9:14: error: 'tb' was not declared in this scope; did you mean 'tm'?
    9 |         ta=a;tb=b;
      |              ^~
      |              tm
a.cc:12:19: error: expected ';' before 'tmp'
   12 |                 ll tmp=b;
      |                   ^~~~
      |                   ;
a.cc:14:19: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   14 |                 a=tmp;
      |                   ^~~
      |                   tm
Language: C++

	//PCK2003////
#include<iostream>
#include<algorithm>
using namespace std;
#define long long ll;
int main(){
long long  a,b,ta,tb;
	
	while(cin>>a>>b){
	ta=a;tb=b;
	if(a<b)swap(a,b);
	while(1){
		long long  tmp=b;
		b=a%b;
		a=tmp;
		//cout<<a<<b<<endl;
		if(b==0)break;
	}
	cout<<a<<" "<<ta*tb/a<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:19: error: redeclaration of 'long int ll'
    5 | #define long long ll;
      |                   ^~
a.cc:7:6: note: in expansion of macro 'long'
    7 | long long  a,b,ta,tb;
      |      ^~~~
a.cc:5:19: note: 'long int ll' previously declared here
    5 | #define long long ll;
      |                   ^~
a.cc:7:1: note: in expansion of macro 'long'
    7 | long long  a,b,ta,tb;
      | ^~~~
a.cc:7:12: error: 'a' was not declared in this scope
    7 | long long  a,b,ta,tb;
      |            ^
a.cc:7:14: error: 'b' was not declared in this scope
    7 | long long  a,b,ta,tb;
      |              ^
a.cc:7:16: error: 'ta' was not declared in this scope; did you mean 'tm'?
    7 | long long  a,b,ta,tb;
      |                ^~
      |                tm
a.cc:7:19: error: 'tb' was not declared in this scope; did you mean 'tm'?
    7 | long long  a,b,ta,tb;
      |                   ^~
      |                   tm
a.cc:5:19: error: redeclaration of 'long int ll'
    5 | #define long long ll;
      |                   ^~
a.cc:13:22: note: in expansion of macro 'long'
   13 |                 long long  tmp=b;
      |                      ^~~~
a.cc:5:19: note: 'long int ll' previously declared here
    5 | #define long long ll;
      |                   ^~
a.cc:13:17: note: in expansion of macro 'long'
   13 |                 long long  tmp=b;
      |                 ^~~~
a.cc:13:28: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   13 |                 long long  tmp=b;
      |                            ^~~
      |                            tm
Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main(){
	long long int a,b,ans;
	while(cin>>a>>b){
		for(int i=2;i<=(min(a,b);i++){
			if(a%i==0 && b%i==0)ans=i;
		}
		cout<<ans<<ans*(a/ans)*(b/ans)<<endl;
	}
    return 0;
}

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

# -*- coding: utf-8 -*-
import sys

def gcd(a,b):
    while a%b:
        a,b = b,a%b
    return b

def lcm(a,b):
    return a*b/gcd(a,b)

for s in sys.stdin:
    a,b = map(int,s.split())
    a,b = max(a,b),min(a,b)
    print gcd(a,b),lcm(a,b)

Compiler output:
a.cc:1:3: error: invalid preprocessing directive #-
    1 | # -*- coding: utf-8 -*-
      |   ^
a.cc:2:1: error: 'import' does not name a type
    2 | import sys
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

# -*- coding: utf-8 -*-
import sys
import fractions

def lcm(a,b):
    return a / fractions.gcd(a,b) * b

for s in sys.stdin:
    a,b = map(int,s.split())
    gcd_ab = fractions.gcd(a,b)
    lcm_ab = lcm(a,b)

    print gcd_ab,lcm_ab

Compiler output:
a.cc:1:3: error: invalid preprocessing directive #-
    1 | # -*- coding: utf-8 -*-
      |   ^
a.cc:2:1: error: 'import' does not name a type
    2 | import sys
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<cmath>
#include<queue>
#include<stack>
using namespace std;
#define int long long

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

unsigned main(){
    int A,B;
	while(cin>>A>>B){
		printf("%d %d\n",gcd(A,B),A*B/gcd(A,B));
	}
    return 0;
}

Compiler output:
cc1plus: error: '::main' must return 'int'
a.cc: In function 'long long int gcd(long long int, long long int)':
a.cc:13:17: warning: control reaches end of non-void function [-Wreturn-type]
   13 |         else gcd(b,a%b);
      |              ~~~^~~~~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<cmath>
#include<queue>
#include<stack>
using namespace std;
#define int long long

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

unsigned main(){
    int A,B;
	while(cin>>A>>B){
		printf("%lld %lld\n",gcd(A,B),A*B/gcd(A,B));
	}
    return 0;
}

Compiler output:
cc1plus: error: '::main' must return 'int'
a.cc: In function 'long long int gcd(long long int, long long int)':
a.cc:13:17: warning: control reaches end of non-void function [-Wreturn-type]
   13 |         else gcd(b,a%b);
      |              ~~~^~~~~~~
Language: C++

import java.util.Scanner;

class Main {
	public static long a, b;
	public static void main(String[] args) {
		Scanner cin = new Scanner(System.in);
		while(cin.hasNext()){
			a = cin.nextLong();
			b = cin.nextLong();
			solve();
		}
	}
	
	public static void solve() {
		if(a < b){
			Long tmp = a;
			a = b;
			b = a;
		}
		Long g = gcd(a, b);
		System.out.printf("%d %d", g, a * b / g);
	}
	public static Long gcd(Long x, Long y){
		if(y == 0){
			return x;
		}
		return gcd(y, x % y);
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:15: error: expected ':' before 'static'
    4 |         public static long a, b;
      |               ^~~~~~~
      |               :
a.cc:5:15: error: expected ':' before 'static'
    5 |         public static void main(String[] args) {
      |               ^~~~~~~
      |               :
a.cc:5:33: error: 'String' has not been declared
    5 |         public static void main(String[] args) {
      |                                 ^~~~~~
a.cc:5:42: error: expected ',' or '...' before 'args'
    5 |         public static void main(String[] args) {
      |                                          ^~~~
a.cc:14:15: error: expected ':' before 'static'
   14 |         public static void solve() {
      |               ^~~~~~~
      |               :
a.cc:23:15: error: expected ':' before 'static'
   23 |         public static Long gcd(Long x, Long y){
      |               ^~~~~~~
      |               :
a.cc:23:23: error: 'Long' does not name a type; did you mean 'long'?
   23 |         public static Long gcd(Long x, Long y){
      |                       ^~~~
      |                       long
a.cc:29:2: error: expected ';' after class definition
   29 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:6:17: error: 'Scanner' was not declared in this scope
    6 |                 Scanner cin = new Scanner(System.in);
      |                 ^~~~~~~
a.cc:7:23: error: 'cin' was not declared in this scope
    7 |                 while(cin.hasNext()){
      |                       ^~~
a.cc: In static member function 'static void Main::solve()':
a.cc:16:25: error: 'Long' was not declared in this scope; did you mean 'long'?
   16 |                         Long tmp = a;
      |                         ^~~~
      |                         long
a.cc:20:17: error: 'Long' was not declared in this scope; did you mean 'long'?
   20 |                 Long g = gcd(a, b);
      |                 ^~~~
      |                 long
a.cc:21:17: error: 'System' was not declared in this scope
   21 |                 System.out.printf("%d %d", g, a * b / g);
      |                 ^~~~~~
a.cc:21:44: error: 'g' was not declared in this scope
   21 |                 System.out.printf("%d %d", g, a * b / g);
      |                                            ^
Language: C++

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

using namespace std;

int gcd(int a, int b) {
    return b > 0 ? gcd(b, a % b) : a;
}
int main() {
    int  a, b;
    while (scanf("%d%d", &a, &b) != EOF) {
        printf("%d %lld", gcd(a, b), (ll)a / gcd(a, b) * b);
    }

    return 0;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:39: error: 'll' was not declared in this scope
   14 |         printf("%d %lld", gcd(a, b), (ll)a / gcd(a, b) * b);
      |                                       ^~
Language: C++

#include <iostream>

using std;

int main(){
    long a,b;
    a=0;b=0;
    cin >> a >> b;
    if(a<b) {
        long c;
        c=a;
        a=b;
        b=c;
    }
    long answer;
    long d,e,f;
    for(;;){
         if(e==f){
             answer = a*b/f;
             break;
         }
         d=e-f;
         e=f;
         f=d;
    }
    cout<<f<<" "<<answer<<endl;
    return 0;
}
    

         

Compiler output:
a.cc:3:7: error: expected nested-name-specifier before 'std'
    3 | using std;
      |       ^~~
a.cc: In function 'int main()':
a.cc:8:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |     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:26:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   26 |     cout<<f<<" "<<answer<<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:26:27: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   26 |     cout<<f<<" "<<answer<<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<cstdio>
typedef unsigned long long ll;
int gcd(int a,int b)
{
	if(b==0)return a;
	else return gcd(b,a%b);
}
int main()
{
	ll n,m;
	while(scanf("%d%d",&n,&m)==2)
	{
		ll d = gcd(n,m),ll ans = n/d*m;
		printf("%lld %lld\n",d,n*m/d);
	}
	return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:13:36: error: expected initializer before 'ans'
   13 |                 ll d = gcd(n,m),ll ans = n/d*m;
      |                                    ^~~
Language: C++

#include<stdio.h>
#include<iostream>
using namespace std;
int main(){

long long int a,b,A,B;

while(cin>>a>>b){
 A=a;B=b;
 while (b)
      {
	int tmp = a % b;
	a = b;
	b = tmp;
      }

b=A*B/a
cout<<a<<" "<<b<<endl;
}
return 0;
}

    

Compiler output:
a.cc: In function 'int main()':
a.cc:17:8: error: expected ';' before 'cout'
   17 | b=A*B/a
      |        ^
      |        ;
   18 | cout<<a<<" "<<b<<endl;
      | ~~~~
Language: C++

#include<iostream>
using namespace std;

int main(){
	long int gcd[200],num1,num2,lcm[200];
	int a,b;
	int i=0;
	
	while(cin >> a >> b){
		num1 = a;
		num2 = b;
	
		if( a<b ){
			num2 = a;
			num1 = b;
		}
		
		while( (gcd[i]=num1%num2) != 0){
			num1 = num2;
			num2 = ggd[i];
		}
		gcd[i] = num2;
		lcm[i] = a / gcd[i] * b;
		i++;
	}
	
	for(int j=0; j<i; j++)
		cout << gcd[j] <<" "<< lcm[j] << "\n";
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:32: error: 'ggd' was not declared in this scope; did you mean 'gcd'?
   20 |                         num2 = ggd[i];
      |                                ^~~
      |                                gcd
Language: C++

#include<iostream>

int main(){
	int a,b;
	
	while( cin >> a >> b ){
		int num1 = a;
		int num2 = b;
	
		if( a<b ){
			num2 = a;
			num1 = b;
		}
		
		while( (int gcd = num1%num2) != 0){
			num1 = num2;
			num2 = gcd;
		}
		gcd = num2;
		int lcm = a / gcd * b;
		cout << gcd <<" "<< lcm << "\n";
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:16: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |         while( 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:15:25: error: expected primary-expression before 'int'
   15 |                 while( (int gcd = num1%num2) != 0){
      |                         ^~~
a.cc:15:25: error: expected ')' before 'int'
   15 |                 while( (int gcd = num1%num2) != 0){
      |                        ~^~~
      |                         )
a.cc:18:18: error: expected ')' before 'gcd'
   18 |                 }
      |                  ^
      |                  )
   19 |                 gcd = num2;
      |                 ~~~
a.cc:15:22: note: to match this '('
   15 |                 while( (int gcd = num1%num2) != 0){
      |                      ^
a.cc:19:17: error: 'gcd' was not declared in this scope
   19 |                 gcd = num2;
      |                 ^~~
a.cc:20:31: error: 'gcd' was not declared in this scope
   20 |                 int lcm = a / gcd * b;
      |                               ^~~
a.cc:21:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   21 |                 cout << gcd <<" "<< lcm << "\n";
      |                 ^~~~
      |                 std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include<iostream>

int main(){
	int a,b;
	
	while( std::cin >> a >> b ){
		int num1 = a;
		int num2 = b;
	
		if( a<b ){
			num2 = a;
			num1 = b;
		}
		
		while( (int gcd = num1%num2) != 0){
			num1 = num2;
			num2 = gcd;
		}
		gcd = num2;
		int lcm = a / gcd * b;
		std::cout << gcd <<" "<< lcm << "\n";
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:25: error: expected primary-expression before 'int'
   15 |                 while( (int gcd = num1%num2) != 0){
      |                         ^~~
a.cc:15:25: error: expected ')' before 'int'
   15 |                 while( (int gcd = num1%num2) != 0){
      |                        ~^~~
      |                         )
a.cc:18:18: error: expected ')' before 'gcd'
   18 |                 }
      |                  ^
      |                  )
   19 |                 gcd = num2;
      |                 ~~~
a.cc:15:22: note: to match this '('
   15 |                 while( (int gcd = num1%num2) != 0){
      |                      ^
a.cc:19:17: error: 'gcd' was not declared in this scope
   19 |                 gcd = num2;
      |                 ^~~
a.cc:20:31: error: 'gcd' was not declared in this scope
   20 |                 int lcm = a / gcd * b;
      |                               ^~~
Language: C++

#include <iostream>

int main(){

	u_int a, b;

	while(std::cin >> a >> b){

		u_int minmul; //least common multiple
		u_int maxdivi = 1; //greatest common divisor
		u_int small;

		if(a > b)
			small = b;
		else
			small = a;

		for(int i = 2; i <= small; i++){
			if(a % i == 0  &&  b % i == 0){
				maxdivi = maxdivi * i;
				i = 2;
			}
		}
		minmul = a * b / maxdivi;

	std::cout << maxdivi << minimul << std::endl;

	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:33: error: 'minimul' was not declared in this scope; did you mean 'minmul'?
   26 |         std::cout << maxdivi << minimul << std::endl;
      |                                 ^~~~~~~
      |                                 minmul
Language: C++

#include<iostream>

int main(){
	long int a, b, r;
	
	while(std::cin >> a >> b){
		long int product = a*b;
		
		// GCD
		if(a < b){
			long int temp = a;
			a = b;
			b = temp;
		}
		while((r = a%b) != 0){
			a = b;
			b = r;
		}
		
		// LCM
		long int lcm = product / b;
		
		// show
		std::cout << b << " " << lcm << std::endl;
	}
	
	return 0;
}}

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

#include<stdio.h>

using namespace std;

int max(int x, int y){
        int r;

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

long long int small(long long int x,long long  int y, int r){
        if(x * y % r  == 0)
                return x * y / r;
        else
                return x * y;
}       

int main(){
        int x,y,r;

        while((scanf("%ld %ld",&x,&y)) != EOF){
                if(x < y){
                        int num = y;
                        y = x;
                        x = num;
                } 
                cout << max(x,y) << " " << small(x,y,max(x,y)) << endl;
        }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:17: error: 'cout' was not declared in this scope
   31 |                 cout << max(x,y) << " " << small(x,y,max(x,y)) << endl;
      |                 ^~~~
a.cc:2:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<stdio.h>
  +++ |+#include <iostream>
    2 | 
a.cc:31:67: error: 'endl' was not declared in this scope
   31 |                 cout << max(x,y) << " " << small(x,y,max(x,y)) << endl;
      |                                                                   ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include<stdio.h>
  +++ |+#include <ostream>
    2 |
Language: C++

#include <iostream>
using namespace std;

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:13:7: error: 'con' was not declared in this scope
   13 | while(con >> a >> b) {
      |       ^~~
a.cc:15:2: error: expected '}' at end of input
   15 | }
      |  ^
a.cc:11:12: note: to match this '{'
   11 | int main() {
      |            ^
Language: C++

#include <cstdio>
using namespace std;
int a, b, d, e;
int gcd(int x, int y)
{
	if (x<y)
	{
		x+=y;
		y=x-y;
		x-=y;
	}
	if (y==0)
	return x;
	else
	return gcd(y, x%y)
}
int lcm(int x, int y)
{
	return (long long)x*y/d;
}
int main()
{ 
	while (scanf("%d%d", &a, &b)!=EOF)
	{
		d = gcd(a,b);
		e = lcm(a, b);
		printf("%lld %lld\n", d, e);
	}
}

Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:15:27: error: expected ';' before '}' token
   15 |         return gcd(y, x%y)
      |                           ^
      |                           ;
   16 | }
      | ~
Language: C++

import java.util.*;

class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
while(sc.hasNextInt()){
int a=sc.nextInt();
int b=sc.nextInt();
int c=gcd(a,b);
int d=a*b/c;
System.out.printf("%d %d%n",c,d);
}
}
public static int gcd(int x,int y){
int max=Math.max(x,y);
int min=Math.min(x,y);
if(max%min==0){return min;}
return gcd(min,max%min);
}
}

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:7: error: expected ':' before 'static'
    4 | public static void main(String[] args){
      |       ^~~~~~~
      |       :
a.cc:4:25: error: 'String' has not been declared
    4 | public static void main(String[] args){
      |                         ^~~~~~
a.cc:4:34: error: expected ',' or '...' before 'args'
    4 | public static void main(String[] args){
      |                                  ^~~~
a.cc:14:7: error: expected ':' before 'static'
   14 | public static int gcd(int x,int y){
      |       ^~~~~~~
      |       :
a.cc:20:2: error: expected ';' after class definition
   20 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:5:1: error: 'Scanner' was not declared in this scope
    5 | Scanner sc=new Scanner(System.in);
      | ^~~~~~~
a.cc:6:7: error: 'sc' was not declared in this scope
    6 | while(sc.hasNextInt()){
      |       ^~
a.cc:11:1: error: 'System' was not declared in this scope
   11 | System.out.printf("%d %d%n",c,d);
      | ^~~~~~
a.cc: In static member function 'static int Main::gcd(int, int)':
a.cc:15:9: error: 'Math' was not declared in this scope
   15 | int max=Math.max(x,y);
      |         ^~~~
Language: C++

// B.cpp

#include <iostream>

using namespace std;

int gcd(int, int);
int lcm(int, int);

int main(void) {
	int a, b;
	cin >> a >> b; 
	cout << gcd(a, b) << " " <<  lcm(a, b) << endl;

	return 0;
}

int gcd(int a, int b) {
	int max, min, res;
	
	res = 1;
	
	if(a > b){
		max = a, min = b;
	}
	if(a =< b){
		max = b, min = a;
	}
	if(min == 0) return max;
	while(res) {
		res = max % min;
		max = min;
		min = res;
	}
	return max;
}
int lcm(int a, int b) {
	return a / gcd(a, b) * b;
}

Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:26:15: error: expected primary-expression before '<' token
   26 |         if(a =< b){
      |               ^
Language: C++

#include<iostream>
#include<argolithm>

int main(void)
{
	unsigned int a, b, g, l;

	while( std::cin >> a >> b ){
		g = gcd( a, b );
		l = a * b / g;
		std::cout << g << std::endl;
		std::cout << l << std::endl;
	}

	return 0;
}

int gcd( int a, int b ){
	int n, i;
	unsigned int tmp[4];

	tmp[0] = std::max( a, b );
	tmp[1] = std::mix( a, b );

	for( n = 0;; n++ ){
		for( i = 1;(tmp[( n + 2 ) % 3 ] = tmp[ n % 3 ] - tmp[( n + 1 ) % 3 ] * i ) >= tmp[( n + 1 ) % 3]; i++ ){
			if( tmp[( n + 2 ) % 3 ] == 0 ){
				return tmp[( n + 1 ) % 3 ];
			}
		}
		if( n > 2000000000 ){
			return -1;
		}
	}

	return -1;
}

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

#include<iostream>
#include<argolithm>

int gcd( unsigned int, unsigned int );
int main(void)
{
	unsigned int a, b, g, l;

	while( std::cin >> a >> b ){
		g = gcd( a, b );
		l = a * b / g;
		std::cout << g << std::endl;
		std::cout << l << std::endl;
	}

	return 0;
}

int gcd( unsigned int a, unsigned int b ){
	int n, i;
	unsigned int tmp[4];

	tmp[0] = std::max( a, b );
	tmp[1] = std::mix( a, b );

	for( n = 0;; n++ ){
		for( i = 1;(tmp[( n + 2 ) % 3 ] = tmp[ n % 3 ] - tmp[( n + 1 ) % 3 ] * i ) >= tmp[( n + 1 ) % 3]; i++ ){
			if( tmp[( n + 2 ) % 3 ] == 0 ){
				return tmp[( n + 1 ) % 3 ];
			}
		}
		if( n > 2000000000 ){
			return -1;
		}
	}

	return -1;
}

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

#include<iostream>
#include<argorithm>

int gcd( unsigned int, unsigned int );
int main(void)
{
	unsigned int a, b, g, l;

	while( std::cin >> a >> b ){
		g = gcd( a, b );
		l = a * b / g;
		std::cout << g << std::endl;
		std::cout << l << std::endl;
	}

	return 0;
}

int gcd( unsigned int a, unsigned int b ){
	int n, i;
	unsigned int tmp[4];

	tmp[0] = std::max( a, b );
	tmp[1] = std::mix( a, b );

	for( n = 0;; n++ ){
		for( i = 1;(tmp[( n + 2 ) % 3 ] = tmp[ n % 3 ] - tmp[( n + 1 ) % 3 ] * i ) >= tmp[( n + 1 ) % 3]; i++ ){
			if( tmp[( n + 2 ) % 3 ] == 0 ){
				return tmp[( n + 1 ) % 3 ];
			}
		}
		if( n > 2000000000 ){
			return -1;
		}
	}

	return -1;
}

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

#include<iostream>
#include<algorithm>

int gcd( unsigned int, unsigned int );
int main(void)
{
	unsigned int a, b, g, l;

	while( std::cin >> a >> b ){
		g = gcd( a, b );
		l = a * b / g;
		std::cout << g << std::endl;
		std::cout << l << std::endl;
	}

	return 0;
}

int gcd( unsigned int a, unsigned int b ){
	int n, i;
	unsigned int tmp[4];

	tmp[0] = std::max( a, b );
	tmp[1] = std::mix( a, b );

	for( n = 0;; n++ ){
		for( i = 1;(tmp[( n + 2 ) % 3 ] = tmp[ n % 3 ] - tmp[( n + 1 ) % 3 ] * i ) >= tmp[( n + 1 ) % 3]; i++ ){
			if( tmp[( n + 2 ) % 3 ] == 0 ){
				return tmp[( n + 1 ) % 3 ];
			}
		}
		if( n > 2000000000 ){
			return -1;
		}
	}

	return -1;
}

Compiler output:
a.cc: In function 'int gcd(unsigned int, unsigned int)':
a.cc:24:23: error: 'mix' is not a member of 'std'; did you mean 'min'?
   24 |         tmp[1] = std::mix( a, b );
      |                       ^~~
      |                       min
Language: C++

//#define _USE_MATH_DEFINES
#include <iostream>
//#include <stdio.h>
//#include <iomanip>
//#include <vector>
//#include <string>
//#include <algorithm>
//#include <functional>
//#include <cmath>

using namespace std;

long gcd(long a, long b){
	long A, B, R;

	if (a > b){
		A = a;
		B = b;
	}
	else{
		A = b;
		B = a;
	}

	while (1){
		R = A % B;
		if (R == 0){
			return B;
		}
		else{
			A = B;
			B = R;
		}
	}
}

long lcm(long a, long b){
	long A, B;

	A = a;
	B = b;

	while (1){
		if (A > B){
			B = ceil((float)A / (float)b) * b;
		}
		else{
			A = ceil((float)B / (float)a) * a;
		}

		if (A == B) return A;
	}

}


int main(){

	int n;
	long a, b;
	long gcd_a, lcm_a;


	while (cin >> a >> b){

		gcd_a = gcd(a, b);
		lcm_a = lcm(a, b);

		cout << gcd_a << " " << lcm_a << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'long int lcm(long int, long int)':
a.cc:45:29: error: 'ceil' was not declared in this scope
   45 |                         B = ceil((float)A / (float)b) * b;
      |                             ^~~~
a.cc:48:29: error: 'ceil' was not declared in this scope
   48 |                         A = ceil((float)B / (float)a) * a;
      |                             ^~~~
Language: C++

#include<cstdio>
int g(int x,int y){return y?g(y,x%y):x;}
int main(){
int x,y;
while(~scanf("%d%d",&x,&y))printf("%d %d\n",g(x,y),a*b/g(x,y));
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:52: error: 'a' was not declared in this scope
    5 | while(~scanf("%d%d",&x,&y))printf("%d %d\n",g(x,y),a*b/g(x,y));
      |                                                    ^
a.cc:5:54: error: 'b' was not declared in this scope
    5 | while(~scanf("%d%d",&x,&y))printf("%d %d\n",g(x,y),a*b/g(x,y));
      |                                                      ^
Language: C++

#include<cstdio>
int g(int x,int y){return y?g(y,x%y):x;}
int main(){
int x,y;
while(cin>>x>>y)printf("%d %d\n",g(x,y),x*y/g(x,y));
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:7: error: 'cin' was not declared in this scope
    5 | while(cin>>x>>y)printf("%d %d\n",g(x,y),x*y/g(x,y));
      |       ^~~
Language: C++

#include<iostream>

using namespace std;

int main(){
	int a, b, c, d,r,s,h;
	for (cin >> a >> b){
		//c
		h = a;
		s = b; {
			r = h % s;
			if (r == 0) {
				c = s;
				break;
			}
			h = s;
			s = r;
		}

		//d
		h = a;
		s = b;
		if (a < b){
			for (;;){
				if ((b % a) == 0){
					d = b;
					break;
				}
				b = b + s;
			}
		}
		else if (a >= b){
			for (;;){
				if ((a % b) == 0){
					d = a;
					break;
				}
				a = a + h;
			}
		}

		cout << c << " " << d << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:27: error: expected ';' before ')' token
    7 |         for (cin >> a >> b){
      |                           ^
      |                           ;
a.cc:44:1: error: expected primary-expression before '}' token
   44 | }
      | ^
a.cc:43:10: error: expected ';' before '}' token
   43 |         }
      |          ^
      |          ;
   44 | }
      | ~         
a.cc:44:1: error: expected primary-expression before '}' token
   44 | }
      | ^
a.cc:43:10: error: expected ')' before '}' token
   43 |         }
      |          ^
      |          )
   44 | }
      | ~         
a.cc:7:13: note: to match this '('
    7 |         for (cin >> a >> b){
      |             ^
a.cc:44:1: error: expected primary-expression before '}' token
   44 | }
      | ^
Language: C++

import sys
for line in sys.stdin:
    a, b = map(int, line.split())
    c = a * b
    while b:
        a, b = b, a % b
    print(str(a) + ' ' + str(c / a))

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>
#include<cstdio>
using namespace std;

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

int main()
{
	int a, b;
	while (scanf_s("%d%d", &a, &b))
	{
		int g = gcd(a, b);
		int lcm = a / g*b;
		printf("%d %d\n", g, lcm);
	}
}

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

#include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <queue>

#include <map>
#include <set>
#include <string>
#include <algorithm>
#include <functional>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define INF 1<<30
#define ALEN(ARR) (sizeof(ARR) / sizeof(ARR[0]))
#define MP make_pair
#define mp make_pair
#define pb push_back
#define PB push_back
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define ll long long
#define ull unsigned long long
#define MOD 1000000007

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

int lcm(int a, int b) {
    if(a == 0 || b == 0) {
        cout << "Error" << endl;
        return 0;
    }

    return (a * b / gcd(a, b));
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout.precision(16);

  int a, b;
  while(cin >> a >> b) cout << gcd(x, y) << " " << lcm(x, y) << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:53:36: error: 'x' was not declared in this scope
   53 |   while(cin >> a >> b) cout << gcd(x, y) << " " << lcm(x, y) << endl;
      |                                    ^
a.cc:53:39: error: 'y' was not declared in this scope
   53 |   while(cin >> a >> b) cout << gcd(x, y) << " " << lcm(x, y) << endl;
      |                                       ^
Language: C++

def gcd(a,b)
      return a if b == 0
      gcd(b,a%b)
end
def lcm(a,b)
      return a * b / gcd(a,b)
end
while line = gets
      a,b = line.split.map(&:to_i)
      p "#{gcd(a,b)} #{lcm(a,b)}"
end

Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def gcd(a,b)
      | ^~~
Language: C++

def gcd(a,b)
      if b==0
            a
      else
            gcd(b,a%b)
end
def lcm(a,b){a * b / gcd(a,b)}
while line = gets
      a,b = line.split.map(&:to_i)
      print gcd(a,b)," ",lcm(a,b),"\n"
end

Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def gcd(a,b)
      | ^~~
a.cc:8:1: error: expected unqualified-id before 'while'
    8 | while line = gets
      | ^~~~~
Language: C++

#include <stdio.h>
int gcd(__int64 a,__int64 b){
	return b==0?a:gcd(b,a%b);
}
__int64 a,b;
int main()
{
	while(scanf("%ld%ld",&a,&b) != EOF){
		printf("%ld\n%ld\n",gcd(a,b),a * b / gcd(a,b));
	}
	return 0;
}

Compiler output:
a.cc:2:9: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
    2 | int gcd(__int64 a,__int64 b){
      |         ^~~~~~~
      |         __int64_t
a.cc:2:19: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
    2 | int gcd(__int64 a,__int64 b){
      |                   ^~~~~~~
      |                   __int64_t
a.cc:2:28: error: expression list treated as compound expression in initializer [-fpermissive]
    2 | int gcd(__int64 a,__int64 b){
      |                            ^
a.cc:5:1: error: '__int64' does not name a type; did you mean '__int64_t'?
    5 | __int64 a,b;
      | ^~~~~~~
      | __int64_t
a.cc: In function 'int main()':
a.cc:8:31: error: 'a' was not declared in this scope
    8 |         while(scanf("%ld%ld",&a,&b) != EOF){
      |                               ^
a.cc:8:34: error: 'b' was not declared in this scope
    8 |         while(scanf("%ld%ld",&a,&b) != EOF){
      |                                  ^
a.cc:9:40: error: 'gcd' cannot be used as a function
    9 |                 printf("%ld\n%ld\n",gcd(a,b),a * b / gcd(a,b));
      |                                     ~~~^~~~~
a.cc:9:57: error: 'gcd' cannot be used as a function
    9 |                 printf("%ld\n%ld\n",gcd(a,b),a * b / gcd(a,b));
      |                                                      ~~~^~~~~
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 / __gcd(n, m) * m);
????????}
????????return 0;
}

Compiler output:
a.cc:5:1: error: expected unqualified-id before '?' token
    5 | ??
      | ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:12: error: 'num_a' was not declared in this scope
    5 | while(cin>>num_a>>num_b){
      |            ^~~~~
a.cc:5:19: error: 'num_b' was not declared in this scope
    5 | while(cin>>num_a>>num_b){
      |                   ^~~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <fstream>
#include <sstream>
#include <string>
#include <iomanip>
#include <math.h>
#include <limits>

using namespace std;

typedef unsigned long long ullong;

class cgl
{
public:
	ullong gcd(ullong, ullong);
	ullong lcm(ullong, ullong, ullong);
};

ullong cgl::gcd(ullong a, ullong b)
{
	if (a % b == 0)
		return b;
	return gcd(b, a % b);
}

ullong cgl::lcm(ullong a, ullong b, ullong g)
{
	return a * b / g;
}

int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);

	cgl cg;
	ullong a, b, g;

	for (;;)
	{
		cin >> a >> b;
		if (fin.fail()) break;
		g = cg.gcd(a, b);
		cout << g << " " << cg.lcm(a, b, g) << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:21: error: 'fin' was not declared in this scope; did you mean 'sin'?
   45 |                 if (fin.fail()) break;
      |                     ^~~
      |                     sin
Language: C++

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

using namespace std;

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

int main()
{
	__int64 a, b, t;
	while (scanf("%I64d%I64d", &a, &b) != EOF)
	{
		if (a < b)
			t = gcd(b, a);
		else
			t = gcd(a, b);
		printf("%I64d %I64d\n", t, a * b / t);
	}
	return 0;
}

Compiler output:
a.cc:6:1: error: '__int64' does not name a type; did you mean '__int64_t'?
    6 | __int64 gcd(__int64 a, __int64 b)
      | ^~~~~~~
      | __int64_t
a.cc: In function 'int main()':
a.cc:15:9: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
   15 |         __int64 a, b, t;
      |         ^~~~~~~
      |         __int64_t
a.cc:16:37: error: 'a' was not declared in this scope
   16 |         while (scanf("%I64d%I64d", &a, &b) != EOF)
      |                                     ^
a.cc:16:41: error: 'b' was not declared in this scope
   16 |         while (scanf("%I64d%I64d", &a, &b) != EOF)
      |                                         ^
a.cc:19:25: error: 't' was not declared in this scope; did you mean 'tm'?
   19 |                         t = gcd(b, a);
      |                         ^
      |                         tm
a.cc:19:29: error: 'gcd' was not declared in this scope
   19 |                         t = gcd(b, a);
      |                             ^~~
a.cc:21:25: error: 't' was not declared in this scope; did you mean 'tm'?
   21 |                         t = gcd(a, b);
      |                         ^
      |                         tm
a.cc:21:29: error: 'gcd' was not declared in this scope
   21 |                         t = gcd(a, b);
      |                             ^~~
a.cc:22:41: error: 't' was not declared in this scope; did you mean 'tm'?
   22 |                 printf("%I64d %I64d\n", t, a * b / t);
      |                                         ^
      |                                         tm
Language: C++

#include<stdio.h>
#include<stdlib.h>

int main()
{
  log long int num1,num2,num;
  while(scanf("%lld %lld",num1,&num2)!=EOF){
  num=num1*num2;
  while(num1 !=num2)
  if(num1>num2)
  num1=num1-num2;
  else
  num2=num2-num1;
  }
  printf("%lld %dll\n",num1,num/num1);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'log' was not declared in this scope; did you mean 'long'?
    6 |   log long int num1,num2,num;
      |   ^~~
      |   long
a.cc:7:27: error: 'num1' was not declared in this scope
    7 |   while(scanf("%lld %lld",num1,&num2)!=EOF){
      |                           ^~~~
a.cc:7:33: error: 'num2' was not declared in this scope
    7 |   while(scanf("%lld %lld",num1,&num2)!=EOF){
      |                                 ^~~~
a.cc:8:3: error: 'num' was not declared in this scope; did you mean 'enum'?
    8 |   num=num1*num2;
      |   ^~~
      |   enum
a.cc:15:24: error: 'num1' was not declared in this scope
   15 |   printf("%lld %dll\n",num1,num/num1);
      |                        ^~~~
a.cc:15:29: error: 'num' was not declared in this scope; did you mean 'enum'?
   15 |   printf("%lld %dll\n",num1,num/num1);
      |                             ^~~
      |                             enum