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

#include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <queue>
#include <set>
#include <numeric>
#include <cmath>

using namespace std;

typedef long long int lld;

const lld mod = 1e9+7;
const lld INF = 1e9;
//const lld MAXN = 1e9;

int main()
{
	lld a,b;
	while(cin >> a >> b;)
	{
		lld n = min(a,b);
		lld m = max(a,b);
		lld gcd = 1;
		for(int i = 1; i <= n; i++)
		{
			if (n % i == 0 && m % i == 0)
			{
				gcd = i;
			}
		}
		cout << gcd << endl;
		cout << n * m / gcd << endl;
	}


	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:28: error: expected ')' before ';' token
   22 |         while(cin >> a >> b;)
      |              ~             ^
      |                            )
a.cc:22:29: error: expected primary-expression before ')' token
   22 |         while(cin >> a >> b;)
      |                             ^
Language: C++

#include <iostream>
#include <string>
#include <vector>


class GcdAndLcm
{
public:
    GcdAndLcm() : m_gcd(0), m_lcm(0) {}
    void Run();

private:
    void readData();
    void GetData(std::string s, int& v1, int& v2);
    int calcGcd(int m, int n);
    int calcLcm(int m, int n);
    void Show();

private:
    std::vector<std::string> m_data;
    unsigned int m_gcd;
    unsigned int m_lcm;
};

void GcdAndLcm::Run()
{
    int val1 = 0, val2 = 0;

    readData();
    
    for (unsigned int i = 0; i < m_data.size(); ++i) {
        GetData(m_data[i], val1, val2);
        m_gcd = calcGcd(val1, val2);
        m_lcm = calcLcm(val1, val2);
        Show();
    }
}
void GcdAndLcm::readData()
{
    std::string line;

    while (std::getline(std::cin, line)) {
        m_data.push_back(line);
    }
}

void GcdAndLcm::GetData(std::string s, int& v1, int& v2)
{
    size_t pos = s.find(" ");
    char tmp[100] = { 0 };
    std::strncpy(tmp, s.c_str(), pos);
    v1 = std::atoi(tmp);
    std::memset(tmp, 0x00, sizeof(tmp));
    pos++;
    std::strncpy(tmp, s.c_str() + pos, s.size() - pos);
    v2 = std::atoi(tmp);
}
int GcdAndLcm::calcGcd(int m, int n)
{
    if ((0 == m) || (0 == n))
        return 0;

    while (m != n)
    {
        if (m > n) m = m - n;
        else         n = n - m;
    }
    return m;
}//gcd

int GcdAndLcm::calcLcm(int m, int n)
{
    if ((0 == m) || (0 == n))
        return 0;

    return ((m / calcGcd(m, n)) * n); // lcm = m * n / gcd(m,n)
}//lcm

void GcdAndLcm::Show()
{
    std::cout << m_gcd << " " << m_lcm << std::endl;
}

int main()
{
    GcdAndLcm gcdAndLcm;

    gcdAndLcm.Run();
}

Compiler output:
a.cc: In member function 'void GcdAndLcm::GetData(std::string, int&, int&)':
a.cc:51:10: error: 'strncpy' is not a member of 'std'
   51 |     std::strncpy(tmp, s.c_str(), pos);
      |          ^~~~~~~
a.cc:53:10: error: 'memset' is not a member of 'std'; did you mean 'wmemset'?
   53 |     std::memset(tmp, 0x00, sizeof(tmp));
      |          ^~~~~~
      |          wmemset
a.cc:55:10: error: 'strncpy' is not a member of 'std'
   55 |     std::strncpy(tmp, s.c_str() + pos, s.size() - pos);
      |          ^~~~~~~
Language: C++

#include <iostream>
#include <string>
#include <sstream>
#include <vector>

//typedef struct
//{
//    int left_val;
//    int right_val;
//};

class GcdAndLcm
{
public:
    GcdAndLcm() : m_gcd(0), m_lcm(0) {}
    void Run();

private:
    void readData();
    void GetData(std::string s, int& v1, int& v2);
    int calcGcd(int m, int n);
    int calcLcm(int m, int n);
    void Show();

private:
    std::vector<std::string> m_data;
    unsigned int m_gcd;
    unsigned int m_lcm;
};

void GcdAndLcm::Run()
{
    int val1 = 0, val2 = 0;

    readData();
    
    for (unsigned int i = 0; i < m_data.size(); ++i) {
        GetData(m_data[i], val1, val2);
        m_gcd = calcGcd(val1, val2);
        m_lcm = calcLcm(val1, val2);
        Show();
    }
}
void GcdAndLcm::readData()
{
    std::string line;

    while (std::getline(std::cin, line)) {
        m_data.push_back(line);
    }
}

void GcdAndLcm::GetData(std::string s, int& v1, int& v2)
{
    size_t pos = s.find(" ");
    char tmp[100] = { 0 };
    std::strncpy(tmp, s.c_str(), pos);
    v1 = std::atoi(tmp);
    std::memset(tmp, 0x00, sizeof(tmp));
    pos++;
    std::strncpy(tmp, s.c_str() + pos, s.size() - pos);
    v2 = std::atoi(tmp);
}
int GcdAndLcm::calcGcd(int m, int n)
{
    if ((0 == m) || (0 == n))
        return 0;

    while (m != n)
    {
        if (m > n) m = m - n;
        else         n = n - m;
    }
    return m;
}//gcd

int GcdAndLcm::calcLcm(int m, int n)
{
    if ((0 == m) || (0 == n))
        return 0;

    return ((m / calcGcd(m, n)) * n); // lcm = m * n / gcd(m,n)
}//lcm

void GcdAndLcm::Show()
{
    std::cout << m_gcd << " " << m_lcm << std::endl;
}

int main()
{
    GcdAndLcm gcdAndLcm;

    gcdAndLcm.Run();
}

Compiler output:
a.cc: In member function 'void GcdAndLcm::GetData(std::string, int&, int&)':
a.cc:57:10: error: 'strncpy' is not a member of 'std'
   57 |     std::strncpy(tmp, s.c_str(), pos);
      |          ^~~~~~~
a.cc:59:10: error: 'memset' is not a member of 'std'; did you mean 'wmemset'?
   59 |     std::memset(tmp, 0x00, sizeof(tmp));
      |          ^~~~~~
      |          wmemset
a.cc:61:10: error: 'strncpy' is not a member of 'std'
   61 |     std::strncpy(tmp, s.c_str() + pos, s.size() - pos);
      |          ^~~~~~~
Language: C++

#include <bits/stdc++.h>
#include<iostream>
using namespace std;
int main(){
    int  i,a,b,c;
    while(cin>>a>>b){
        if(a==b){
            cout<<a<<" "<<a<<endl;
        }
        else{
        if(a<b){
            i=b-a;
        }
        else{
            i=a-b;
        }
    for( int j=i;j>0;i-=2){
        if(a%i==0 && b%i==0){
            c=i;
            break;
        }
    }
    cout<<c<<" "<<a*b/c<<endl;
        }
    }
    re

Compiler output:
a.cc: In function 'int main()':
a.cc:26:5: error: 're' was not declared in this scope
   26 |     re
      |     ^~
a.cc:26:7: error: expected '}' at end of input
   26 |     re
      |       ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include<iostream>
using namespace std;
int main(){
int a,b,g,x,y,L;
while(i>50){
cin>>a>>b;
a=x;b=y;
while(1){
  if(x<y){y-x;}
  else if(x>y){x-y;}
  else if(x==y){x=g;break;}
}
L=(a*b)/g;
  cout<<g<<" "<<L<<endl;
  ++i;
}
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:7: error: 'i' was not declared in this scope
    5 | while(i>50){
      |       ^
Language: C++

#include<iostream>
using namespace std;
int main(){
int a,b,x,y,L,i=0;
while(cin>>a>>b){
x=a;y=b;
while(1){
  if(x<y){y=y-x;}
  else if(x>y){x=x-y;}
  else if(x==y){break;}
}
L=(a*b)/g;
cout<<x<<" "<<L<<endl;
x=0;y=0;
  ++i;
  if(i==49){break;}
}
  return 0;
}

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

#include<iostream>
using namespace std;
int main(){
int a,b,x,y,L,i=0;
while(i=0;i<=50;++i{
  cin>>a>>b;
x=a;y=b;
while(1){
  if(x<y){y=y-x;}
  else if(x>y){x=x-y;}
  else if(x==y){break;}
}
L=(a*b)/x;
if(x==1){cout<<y<<" "<<y<<endl;}
else{cout<<y<<" "<<L<<endl;}
}
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:10: error: expected ')' before ';' token
    5 | while(i=0;i<=50;++i{
      |      ~   ^
      |          )
a.cc:5:20: error: expected ';' before '{' token
    5 | while(i=0;i<=50;++i{
      |                    ^
      |                    ;
Language: C++

#include<iostream>
using namespace std;
int main(){
int a,b,x,y,L,i=0;
while(i=0;i<=50;++i){
  cin>>a>>b;
x=a;y=b;
while(1){
  if(x<y){y=y-x;}
  else if(x>y){x=x-y;}
  else if(x==y){break;}
}
L=(a*b)/x;
if(x==1){cout<<y<<" "<<y<<endl;}
else{cout<<y<<" "<<L<<endl;}
}
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:10: error: expected ')' before ';' token
    5 | while(i=0;i<=50;++i){
      |      ~   ^
      |          )
a.cc:5:20: error: expected ';' before ')' token
    5 | while(i=0;i<=50;++i){
      |                    ^
      |                    ;
Language: C++

#include<iostream>
using namespace std;
int main(){
int a,b,x,y,L,i;
while(cin>>a>>b){
x=a;y=b;
while(1){
  if(x<y){y=y-x;x=x-y;}
  else if(x==y){break;}
  else{x=x-y;y=y-x;}
}
L=(a*b)/x;
cout<<y<<" "<<L<<endl;
++i
if(i<=50){break;}
}
}
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:4: error: expected ';' before 'if'
   14 | ++i
      |    ^
      |    ;
   15 | if(i<=50){break;}
      | ~~  
a.cc: At global scope:
a.cc:18:3: error: expected unqualified-id before 'return'
   18 |   return 0;
      |   ^~~~~~
a.cc:19:1: error: expected declaration before '}' token
   19 | }
      | ^
Language: C++

#include<iostream>
#include<stdio.h>
using namespace std;
int main(){
int a,b,x,y,L;
while(cin>>a>>b){
x=a;y=b;
while(1){
  if(x==y){break;}
  else if(x==0)break;
  else if(y==0)break;
  else if(x<y){y=y-x;x=x-y;}
  else{x=x-y;y=y-x;}
}
(float)L=((float)a*(float)b)/(float)x;
cout<<y<<" ";printf("%f",L);cout<<endl;
}
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:1: error: lvalue required as left operand of assignment
   15 | (float)L=((float)a*(float)b)/(float)x;
      | ^~~~~~~~
Language: C++

import sys
def main():
    for line in sys.stdin:
        a,b = map(int, line.split())
        if a > b:
            a,b = b,a
        p = a * b #product

        while True:
            hoge = a
            a = b % a
            b = hoge
            if a == 0:
                gcd = b
                break

        lcm = p // gcd
        print(gcd, lcm)




if __name__ == "__main__":
    main()

Compiler output:
a.cc:7:19: error: stray '#' in program
    7 |         p = a * b #product
      |                   ^
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<stdio.h>
#include<iostream>
#include<iomanip>

#define ll long long
#define REP(i, a) for(int i=0;i<(int)a;++i)
using namespace std;

ll lcm(ll a, ll b) {
    return a * (b / __algo_gcd(a, b));
}

void solver() {
    ll a,b;
    while(cin>>a>>b){
        cout<<__algo_gcd(a,b)<<" "<<lcm(a,b)<<endl;
    }
}

int main() {
    solver();
    return 0;
}

Compiler output:
a.cc: In function 'long long int lcm(long long int, long long int)':
a.cc:10:21: error: '__algo_gcd' was not declared in this scope
   10 |     return a * (b / __algo_gcd(a, b));
      |                     ^~~~~~~~~~
a.cc: In function 'void solver()':
a.cc:16:15: error: '__algo_gcd' was not declared in this scope
   16 |         cout<<__algo_gcd(a,b)<<" "<<lcm(a,b)<<endl;
      |               ^~~~~~~~~~
Language: C++

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

#define ll long long
#define REP(i, a) for(int i=0;i<(int)a;++i)
using namespace std;

ll gcd(ll a, ll b) {
    if (a < b) swap(a, b);
    return b == 0 ? a : gcd(b, a % b);
}

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


void solver() {
    ll a, b;
    while (cin >> a >> b) {
        cout << __algo_gcd(a, b) << " " << lcm(a, b) << endl;
    }
}

int main() {
    solver();
    return 0;
}

Compiler output:
a.cc: In function 'void solver()':
a.cc:22:17: error: '__algo_gcd' was not declared in this scope
   22 |         cout << __algo_gcd(a, b) << " " << lcm(a, b) << endl;
      |                 ^~~~~~~~~~
Language: C++

#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<math.h>
using namespace std;
int main()
{
	int a,b,a1,b1,c;
	while(scanf("%d%d",&a,&b)!=EOF)
	{
		if(a<b)
		{
			a1=b;
			b1=a;
		}
		else
		{
			a1=a;
			b1=b;
		}
		while(1)
		{
			r=a1%b1;
			if(r==0)
				break;
			else
			{
				a1=b1;
				b1=r;
			}
		}
		cout<<r<<" "<<a*b/r<<endl;
	}	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:25: error: 'r' was not declared in this scope
   23 |                         r=a1%b1;
      |                         ^
a.cc:32:23: error: 'r' was not declared in this scope
   32 |                 cout<<r<<" "<<a*b/r<<endl;
      |                       ^
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;

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

int main() {
	int gcd;
	for (int a, b; cin >> a >> b) {
		gcd = GCD(a, b);
		cout << gcd << " " << a * b / gcd << endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:37: error: expected ';' before ')' token
   15 |         for (int a, b; cin >> a >> b) {
      |                                     ^
      |                                     ;
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;

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

int main() {
	int gcd;
	for (int a, b; cin >> a >> b;) {
		gcd = GCD(a, b);
		cout << gcd << " " << a * b / gcd << endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int GCD(int&, int&)':
a.cc:10:24: error: cannot bind non-const lvalue reference of type 'int&' to an rvalue of type 'int'
   10 |         return GCD(b, a%b);
      |                       ~^~
a.cc:6:22: note:   initializing argument 2 of 'int GCD(int&, int&)'
    6 | int GCD(int& a, int& b) {
      |                 ~~~~~^
Language: C++

#include<iostream>
#include<algorithm>
#define LL long long
int main() {
	LL a, b;
	while (std::cin >> a >> b) {
		LL gcd = __gcd(a, b);
		std::cout << __gcd(a,b) << " " << (a*b) / gcd << std::endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:26: error: '__gcd' was not declared in this scope; did you mean 'std::__gcd'?
    7 |                 LL gcd = __gcd(a, b);
      |                          ^~~~~
      |                          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 <iostream>
using namespace std;#include <iostream>
#include <cstdio>
using namespace std;

long long gcd(long long a, long long b){
    long long x,r;
    if(a < b){
      x = a;
      a = b;
      b = x;
      }
    for(x = 0; b != 0; x++){
      r = a%b;
      a = b;
      b = r;
    }
    return a;
}
int main(void){
    long long a, b;

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

    return 0;
}



Compiler output:
a.cc:2:21: error: stray '#' in program
    2 | using namespace std;#include <iostream>
      |                     ^
a.cc:2:22: error: 'include' does not name a type
    2 | using namespace std;#include <iostream>
      |                      ^~~~~~~
Language: C++

#include <stdio.h>

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

    if( a < b ) { temp = a; a = b; b = temp; }
    if( b < 1 ) return -1;

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


int main(){
  int a,b;
  whie(scanf("%d%d",&a,&b) != EOF){
    int g=gcd(a,b);
    printf("%d %d\n",g,a/g*b);
  }

  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:17:3: error: 'whie' was not declared in this scope
   17 |   whie(scanf("%d%d",&a,&b) != EOF){
      |   ^~~~
Language: C++

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

int gcd(int a, int b) {
    
  	int p,q,r;
  	if(a>b){p=b;b=a;a=p;}
	while(r!=0){
	q=b/a;
	r=b%a;
	b=a;
	a=r;
	}
	return b;
}

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









Compiler output:
a.cc: In function 'int main()':
a.cc:19:5: error: 'longint' was not declared in this scope; did you mean 'long'?
   19 |     longint a, b;
      |     ^~~~~~~
      |     long
a.cc:20:18: error: 'a' was not declared in this scope
   20 |     while(cin >> a >> b) {
      |                  ^
a.cc:20:23: error: 'b' was not declared in this scope
   20 |     while(cin >> a >> b) {
      |                       ^
Language: C++

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

int gcd(int a, int b) {
    
  	longint p,q,r;
  	if(a>b){p=b;b=a;a=p;}
	while(r!=0){
	q=b/a;
	r=b%a;
	b=a;
	a=r;
	}
	return b;
}

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









Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:7:9: error: 'longint' was not declared in this scope; did you mean 'long'?
    7 |         longint p,q,r;
      |         ^~~~~~~
      |         long
a.cc:8:17: error: 'p' was not declared in this scope
    8 |         if(a>b){p=b;b=a;a=p;}
      |                 ^
a.cc:9:15: error: 'r' was not declared in this scope
    9 |         while(r!=0){
      |               ^
a.cc:10:9: error: 'q' was not declared in this scope
   10 |         q=b/a;
      |         ^
a.cc: In function 'int main()':
a.cc:19:5: error: 'longint' was not declared in this scope; did you mean 'long'?
   19 |     longint a, b;
      |     ^~~~~~~
      |     long
a.cc:20:18: error: 'a' was not declared in this scope
   20 |     while(cin >> a >> b) {
      |                  ^
a.cc:20:23: error: 'b' was not declared in this scope
   20 |     while(cin >> a >> b) {
      |                       ^
Language: C++

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

int gcd(int a, int b) {
    
  	longint p,q,r;
  	if(a>b){p=b;b=a;a=p;}
	while(r!=0){
	q=b/a;
	r=b%a;
	b=a;
	a=r;
	}
	return b;
}

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









Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:7:9: error: 'longint' was not declared in this scope; did you mean 'long'?
    7 |         longint p,q,r;
      |         ^~~~~~~
      |         long
a.cc:8:17: error: 'p' was not declared in this scope
    8 |         if(a>b){p=b;b=a;a=p;}
      |                 ^
a.cc:9:15: error: 'r' was not declared in this scope
    9 |         while(r!=0){
      |               ^
a.cc:10:9: error: 'q' was not declared in this scope
   10 |         q=b/a;
      |         ^
a.cc: In function 'int main()':
a.cc:19:5: error: 'longint' was not declared in this scope; did you mean 'long'?
   19 |     longint a, b;
      |     ^~~~~~~
      |     long
a.cc:20:18: error: 'a' was not declared in this scope
   20 |     while(cin >> a >> b) {
      |                  ^
a.cc:20:23: error: 'b' was not declared in this scope
   20 |     while(cin >> a >> b) {
      |                       ^
a.cc:21:14: error: expected ';' before 'lcm'
   21 |       longint lcm = a/gcd(a,b)*b;
      |              ^~~~
      |              ;
a.cc:22:34: error: 'lcm' was not declared in this scope
   22 |       cout << gcd(a,b) << " " << lcm << endl;
      |                                  ^~~
Language: C++

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

int gcd(int a, int b) {
  r = a % b;
  while(r!=0){
    a = b;
    b = r;
    r = a % b;
  }

}

int main(void){
   int a, b, tmp;
   if (a < b){
       tmp = b;
	b = a;
	a = tmp;

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


Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:6:3: error: 'r' was not declared in this scope
    6 |   r = a % b;
      |   ^
a.cc:13:1: warning: no return statement in function returning non-void [-Wreturn-type]
   13 | }
      | ^
Language: C++

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

int gcd(int a, int b) {

	for (int i = a; i >= 1; i--)
		if(a % i == 0)
			if(b % i == 0)
				return i;



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


Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:14:15: error: a function-definition is not allowed here before '{' token
   14 | int main(void){
      |               ^
a.cc:21:2: error: expected '}' at end of input
   21 | }
      |  ^
a.cc:5:23: note: to match this '{'
    5 | int gcd(int a, int b) {
      |                       ^
a.cc:21:2: warning: control reaches end of non-void function [-Wreturn-type]
   21 | }
      |  ^
Language: C++

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

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

    if( a < b ) { temp = a; a = b; b = temp; }
    if( b < 1 ) return -1;

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


int main(){
  int a,b;
  while(1){
    cin >> a >> b;
    if(cin.eof())
      break;
    int g=gcd(a,b);
    //printf("%d %d\n",g,a/g*b);
    cout << g << a/g*b << endl;
  }

  return 0;
}



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

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

struct xy
{
	long long x;
	long long y;
};

int getGCD(int a, int b) {
	if (b != 0)
		return getGCD(b, a%b);
	else
		return a;
}
int main()
{
	int a, b;
	vector<xy> dst;
	while (cin >> a >> b ) {
		int GCD = a > b ? getGCD(a, b) : getGCD(b, a);
		long long LCD = long long(a) * long long(b) / long long(GCD);
		dst.push_back({ GCD ,LCD });
	}
	for (vector<xy>::iterator it = dst.begin(); it < dst.end(); it++)
		cout << (*it).x << " " << (*it).y << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:33: error: expected primary-expression before 'long'
   23 |                 long long LCD = long long(a) * long long(b) / long long(GCD);
      |                                 ^~~~
Language: C++

#include <stdio.h>long main(void){
    int a, b, c, d, tmp;
        scanf("%d %d", &a, &b);
     d = a * b;
    if(a < b) {
        tmp = a;
        a = b;
        b = tmp;
    }
     c = a % b;
    while(c != 0) {
        a = b;
        b = c;
        c = a % b;
    }
        printf("%d %d\n", b, d / b);
            return 0;
}



Compiler output:
a.cc:1:24: warning: extra tokens at end of #include directive
    1 | #include <stdio.h>long main(void){
      |                        ^~~~
a.cc:1:10: fatal error: stdio.h>lon: No such file or directory
    1 | #include <stdio.h>long main(void){
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <stdio.h>
long long main(void){
    int a, b, c, d, tmp;
        scanf("%d %d", &a, &b);
     d = a * b;
    if(a < b) {
        tmp = a;
        a = b;
        b = tmp;
    }
     c = a % b;
    while(c != 0) {
        a = b;
        b = c;
        c = a % b;
    }
        printf("%d %d\n", b, d / b);
            return 0;
}



Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include <iostream>
#include <cstdio>using namespace std;
int gcd(int a, int b) {
          int p,q,r;
       if(a<b){p=b;b=a;a=p; 
}

if(a < b) {
  return gcd(b, a);
}

    while(r!=0){
    q=b/a;
    r=b%a;
    b=a;
    a=r;
    }
    return b;
}

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



Compiler output:
a.cc:2:24: warning: extra tokens at end of #include directive
    2 | #include <cstdio>using namespace std;
      |                        ^~~~~~~~~
a.cc:2:10: fatal error: cstdio>usin: No such file or directory
    2 | #include <cstdio>using namespace std;
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <stdio.h>
long long fibo(int n){
    int a, b, c, d, tmp;
        scanf("%d %d", &a, &b);
     d = a * b;
    if(a < b) {
        tmp = a;
        a = b;
        b = tmp;
    }
     c = a % b;
    while(c != 0) {
        a = b;
        b = c;
        c = a % b;
    }
        printf("%d %d\n", b, d / b);
            return 0;
}




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

#include <iostream>
#include <cstdio>using namespace std;
int gcd(int a, int b)

if(a < b) {
  return gcd(b, a);
}

    while(r!=0){
    q=b/a;
    r=b%a;
    b=a;
    a=r;
    }
    return b;
}

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



Compiler output:
a.cc:2:24: warning: extra tokens at end of #include directive
    2 | #include <cstdio>using namespace std;
      |                        ^~~~~~~~~
a.cc:2:10: fatal error: cstdio>usin: No such file or directory
    2 | #include <cstdio>using namespace std;
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

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


Compiler output:
a.cc:1:20: warning: extra tokens at end of #include directive
    1 | #include <iostream>#include <cstdio>using namespace std;int gcd(int a, int b){int p,q,r;if(a<b){p=b;b=a;a=p;}    while(r!=0){    q=b/a;    r=b%a;    b=a;    a=r;    }    return b;}int main(void){    int a, b;    while(cin >> a >> b) {      int lcm = a/gcd(a,b)*b;      cout << gcd(a,b) << " " << lcm << endl;    }    return 0;}
      |                    ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

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

int gcd(int a, int b){

int p,q,r;

if(a<b){p=b;b=a;a=p;

}

while((r=b%a)!=0){
   q=b/a;
   b=a;
   a=r;
   }
   return a;

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



Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:21:1: error: a function-definition is not allowed here before '{' token
   21 | {    int a, b;
      | ^
a.cc:27:2: error: expected '}' at end of input
   27 | }
      |  ^
a.cc:5:22: note: to match this '{'
    5 | int gcd(int a, int b){
      |                      ^
Language: C++

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

int gcd(int a, int b){

int p,q,r;

if(a<b){p=b;b=a;a=p;

}

while((r=b%a)!=0){
   q=b/a;
   b=a;
   a=r;
   
   return a;
}

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



Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:22:1: error: a function-definition is not allowed here before '{' token
   22 | {    int a, b;
      | ^
a.cc:28:2: error: expected '}' at end of input
   28 | }
      |  ^
a.cc:5:22: note: to match this '{'
    5 | int gcd(int a, int b){
      |                      ^
a.cc:28:2: warning: control reaches end of non-void function [-Wreturn-type]
   28 | }
      |  ^
Language: C++

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

int gcd(int a, int b){

int p,q,r;

if(a<b){p=b;b=a;a=p;

}

   while(r!=0){
   q=b/a;
   r=b%a;
   b=a;
   a=r;
   }
   return b;
}

int main(void)
{    int a, b;
     while((r=b%a)!=0){
  q=b/a;
  b=a;
  a=r;
  }
  return a;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:13: error: 'r' was not declared in this scope
   24 |      while((r=b%a)!=0){
      |             ^
a.cc:25:3: error: 'q' was not declared in this scope
   25 |   q=b/a;
      |   ^
Language: C++

include<iostream>
long long gcd(long long a,long long b){
  if(b==0) return a;
  gcd(b,(a%b));
}

int main() {
  long long i,j,res;
  while(std::cin>>i>>j) {
    res=gcd(i,j);
    std::cout<<res<<" "<<(i*j)/res<<"\n";
  }
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:9:14: error: 'cin' is not a member of 'std'
    9 |   while(std::cin>>i>>j) {
      |              ^~~
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:10:9: error: 'gcd' was not declared in this scope
   10 |     res=gcd(i,j);
      |         ^~~
a.cc:11:10: error: 'cout' is not a member of 'std'
   11 |     std::cout<<res<<" "<<(i*j)/res<<"\n";
      |          ^~~~
a.cc:11:10: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include <iostream>

using namespace std;

int main(int argc, char **argv)
{
	int a, b, s, t;
	
	while(cin >> a >> b){
		for(int i = (a > b)? b : a; i >= 1; i--){
			if(b%i == 0 && a%i == 0){
				break;
			}
		}
		s = a;
		t = b;
		while(s != t){
			if(s > t){
				while(s > t){
					t += b;
				}
			} else {
				while(t > s){
					s += a;
				}
			}
		}
		cout << i << " " << s << endl;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:28:25: error: 'i' was not declared in this scope
   28 |                 cout << i << " " << s << endl;
      |                         ^
Language: C++

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

int gcd(int a,int b)
{
    int l,s,r;
    if (a<b)
    {
	l=b;
	s=a;
    } else {
	l=a;
	s=b;
    }
    while(true)
    {
	r=l%s;
	if (r == 0) break;
	l=s;
	s=r;
    }
    return s;
}

int main()
{
    int a,b;
    vector<int> r1,r2;
    while (scanf("%d %d",&a,&b) != EOF)
    {
	r1.push_back(gcd(a,b));
	r2.push_back(a/r1[r1.size()-1]*b);
    }
    for (int i=0; i<r1.size(); i++)
    {

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

main(){
  unsigned int i,j,a,b;
  while(scanf("%d %d",&a,&b)!=-1){
    if(a<b){
      //for(i=1;b%(a/i);for(;a%i;i++))
	//;
      for(i=a;a%i||b%i;i--);
      for(j=i;j%b;j+=i);
    }else{
      for(i=b;a%i||b%i;i--);
      for(j=i;j%a;j+=i);
    }
    printf("%d %d\n",i,j);
  }
  return 0;
}

Compiler output:
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    1 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:3:9: error: 'scanf' was not declared in this scope
    3 |   while(scanf("%d %d",&a,&b)!=-1){
      |         ^~~~~
a.cc:13:5: error: 'printf' was not declared in this scope
   13 |     printf("%d %d\n",i,j);
      |     ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | main(){
Language: C++

gcd(a,b){b==0?a:gcd(b,a%b);}c;main(a,b){while(~scanf("%d%d",&a,&b),c=gcd(a,b))printf("%d %d",c,a/c*b);exit(0);}

Compiler output:
a.cc:1:4: error: expected constructor, destructor, or type conversion before '(' token
    1 | gcd(a,b){b==0?a:gcd(b,a%b);}c;main(a,b){while(~scanf("%d%d",&a,&b),c=gcd(a,b))printf("%d %d",c,a/c*b);exit(0);}
      |    ^
a.cc:1:29: error: 'c' does not name a type
    1 | gcd(a,b){b==0?a:gcd(b,a%b);}c;main(a,b){while(~scanf("%d%d",&a,&b),c=gcd(a,b))printf("%d %d",c,a/c*b);exit(0);}
      |                             ^
a.cc:1:35: error: expected constructor, destructor, or type conversion before '(' token
    1 | gcd(a,b){b==0?a:gcd(b,a%b);}c;main(a,b){while(~scanf("%d%d",&a,&b),c=gcd(a,b))printf("%d %d",c,a/c*b);exit(0);}
      |                                   ^
Language: C++

#include<iostream>
using namesapce 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(cin>>a>>b){
cout<<gcd(a,b)<<" "<<lcm(a,b)<<endl;
}
return 0;
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namesapce'
    2 | using namesapce std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:10:7: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   10 | 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:11:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   11 | cout<<gcd(a,b)<<" "<<lcm(a,b)<<endl;
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:11:32: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   11 | cout<<gcd(a,b)<<" "<<lcm(a,b)<<endl;
      |                                ^~~~
      |                                std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++


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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:15: error: 'cin' was not declared in this scope
    5 |         while(cin >> a >> b){
      |               ^~~
a.cc:22:17: error: 'cout' was not declared in this scope
   22 |                 cout << gcd << " " << lcm << endl;
      |                 ^~~~
a.cc:22:46: error: 'endl' was not declared in this scope
   22 |                 cout << gcd << " " << lcm << endl;
      |                                              ^~~~
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
#include <map>

typedef long long ll;
using namespace std;

ll gcd(ll a, ll b)
{
    while( 1 )
    {
a = a % b;
if( a == 0 )return b;
b = b % a;
if( b == 0 )return a;
    }
}

return a;
}

int main()
{
ll a,b;
while(~scanf("%lld %lld",&a,&b)){
printf("%lld %lld",gcd(a,b),(a*b)/gcd(a,b));
}
}

Compiler output:
a.cc:20:1: error: expected unqualified-id before 'return'
   20 | return a;
      | ^~~~~~
a.cc:21:1: error: expected declaration before '}' token
   21 | }
      | ^
Language: C++

#include <iostream>
using namespace std;

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

void main(){
	long a,b;
	while(!cin.eof()){
		cin >> a >> b;
		long g = gcd(a,b);
		cout << g << " " << a*(b/g);
	}
}

Compiler output:
a.cc:10:1: error: '::main' must return 'int'
   10 | void main(){
      | ^~~~
Language: C++

#include<iostream>
using namespace std;
long long gcm(long long a, long long b){
	if(b > a){
	long long d;
	d = a;
	a = b;
	b = d;
	}	
	long long c;
	while(b!=0){
		c = a % b;
		a = b;
		b = c;
	}
	return a;
}
void main(){
	long long c,d,e;
	std::cin>>c>>d;
	e = gcm(c,d);
	std::cout<<e<<" "<<(c*d)/e;
}

Compiler output:
a.cc:18:1: error: '::main' must return 'int'
   18 | void main(){
      | ^~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
	int a,b,c,d,e;
	
	for(int i=0;i<2;i++){
	std::cin>>a>>b;
	d=a;
	e=b;
	if(b>a){
		d = a;
		a = b;
		b = d;
	}
	while(b!=0){
		c = a % b;
		a = b;
		b = c;
	}
std::cout<<a<<" "<<((e/a)*(d/a)*a)<<endl;8
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:43: error: expected ';' before '}' token
   20 | std::cout<<a<<" "<<((e/a)*(d/a)*a)<<endl;8
      |                                           ^
      |                                           ;
   21 |         }
      |         ~
Language: C++

int main(){
//	m*n = LCM * GCD
	unsigned long long m, n;
	while(cin >> m >> n){
		int LCM, GCD;
		
		if(m<n){
			int swap;
			swap = m;
			m = n;
			n = swap;
		}

		int m_, n_;
		m_ = m;
		n_ = n;
		do {
			if(n_==0){
				GCD = m_;
				break;
			}
			
			int swap = m_ % n_;
			m_ = n_;
			n_ = swap;
		} while(1);
		
		LCM = (m*n)/GCD;
		cout << GCD << " " << LCM << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:15: error: 'cin' was not declared in this scope
    4 |         while(cin >> m >> n){
      |               ^~~
a.cc:29:17: error: 'cout' was not declared in this scope
   29 |                 cout << GCD << " " << LCM << endl;
      |                 ^~~~
a.cc:29:46: error: 'endl' was not declared in this scope
   29 |                 cout << GCD << " " << LCM << endl;
      |                                              ^~~~
Language: C++

long long gcd(long long m, long long n){

	if(m<n){
		long long swap;
		swap = m;
		m = n;
		n = swap;
	}

	do {
		if(n==0){
			return m;
		}
		
		int swap = m % n;
		m = n;
		n = swap;
	} while(1);
}


int main(){
//	m*n = LCM * GCD
	long long m, n;
	while(cin >> m >> n){
		long long  LCM, GCD;
		
		GCD = gcd(m, n);
		LCM = (m*n)/GCD;
		cout << GCD << " " << LCM << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:15: error: 'cin' was not declared in this scope
   25 |         while(cin >> m >> n){
      |               ^~~
a.cc:30:17: error: 'cout' was not declared in this scope
   30 |                 cout << GCD << " " << LCM << endl;
      |                 ^~~~
a.cc:30:46: error: 'endl' was not declared in this scope
   30 |                 cout << GCD << " " << LCM << endl;
      |                                              ^~~~
Language: C++

#include<iostream>

using namespace std;

int main(){
	int a,b,c,d;
	cin >> a >> c;
	b=a; d=c;
	while(b!=d){
		if(d<b){d+=c;}
		else b+=a;
			}
	cout << b << \n;
}

Compiler output:
a.cc:13:22: error: stray '\' in program
   13 |         cout << b << \n;
      |                      ^
a.cc: In function 'int main()':
a.cc:13:23: error: 'n' was not declared in this scope
   13 |         cout << b << \n;
      |                       ^
Language: C++

#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <ctime>
#include <algorithm>
#include <string>

using namespace std;
int main()
{

double x,y,r,a,b;

cin>>x>>y;
a=x;
b=y;
while(x%y!=0)
{
r=x%y;
x=y;
y=r;
}
cout<<y<<" "<<a*b/y<<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:8: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   17 | while(x%y!=0)
      |       ~^~
      |       | |
      |       | double
      |       double
a.cc:19:4: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   19 | r=x%y;
      |   ~^~
      |   | |
      |   | double
      |   double
Language: C++

#include <iostream>

#include <algorithm>


using namespace std;
int main()
{

double x,y,n,a,b;

while(cin>>x>>y)
{
a=x;
b=y;
while(x%y!=0)
{
n=x%y;
x=y;
y=n;
}
cout<<y<<" "<<a*b/y<<endl;
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:8: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   16 | while(x%y!=0)
      |       ~^~
      |       | |
      |       | double
      |       double
a.cc:18:4: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   18 | n=x%y;
      |   ~^~
      |   | |
      |   | double
      |   double
Language: C++

#include <iostream>

#include <algorithm>


using namespace std;
int main()
{

double x,y,n,a,b;

while(cin>>x>>y)
{
a=x;
b=y;
if(x>y)
while(x%y!=0)
{
n=x%y;
x=y;
y=n;
cout<<y<<" "<<a*b/y<<endl;
}
else
while(y%x!=0)
{
n=y%x;
y=x;
x=n;
cout<<x<<" "<<a*b/x<<endl;
}

}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:8: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   17 | while(x%y!=0)
      |       ~^~
      |       | |
      |       | double
      |       double
a.cc:19:4: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   19 | n=x%y;
      |   ~^~
      |   | |
      |   | double
      |   double
a.cc:25:8: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   25 | while(y%x!=0)
      |       ~^~
      |       | |
      |       | double
      |       double
a.cc:27:4: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   27 | n=y%x;
      |   ~^~
      |   | |
      |   | double
      |   double
Language: C++

#include<iostream>
using namespace std;

unsigned long long int GCD();

int main(void){
	while(1){
		unsigned long long int a, b, gcd, lcm, temp;
		if( a < b){
			temp = a;
			a = b;
			b = temp;
		}
		cin >> a >> b;
		if(a == 0 || b == 0)
			return 0;
		gcd = GCD(a,b);
		lcm = a * b / gcd;
		cout << gcd << ' ' << lcm << endl;
	}
	return 0;
}

unsigned long long int GCD(unsinged long long int a, b){
	if(a % b == 0)
		return (b);
	else
		return (GCD(b, a%b);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:26: error: too many arguments to function 'long long unsigned int GCD()'
   17 |                 gcd = GCD(a,b);
      |                       ~~~^~~~~
a.cc:4:24: note: declared here
    4 | unsigned long long int GCD();
      |                        ^~~
a.cc: At global scope:
a.cc:24:47: error: 'long long unsigned int GCD' redeclared as different kind of entity
   24 | unsigned long long int GCD(unsinged long long int a, b){
      |                                               ^~~
a.cc:4:24: note: previous declaration 'long long unsigned int GCD()'
    4 | unsigned long long int GCD();
      |                        ^~~
a.cc:24:28: error: 'unsinged' was not declared in this scope; did you mean 'unsigned'?
   24 | unsigned long long int GCD(unsinged long long int a, b){
      |                            ^~~~~~~~
      |                            unsigned
a.cc:24:54: error: 'b' was not declared in this scope
   24 | unsigned long long int GCD(unsinged long long int a, b){
      |                                                      ^
Language: C++

#include <iostream>
using namespace std;

int main(){
int a;
int b;
int d;
int e;
int f;
while(cin>>d>>e){
a=d;
b=e;
while(1){
c=a%b;
a=b;
b=c;
if(b==0){break;}
}
f=d/a*e;
cout << a <<" ";
cout << f <<endl;}}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:1: error: 'c' was not declared in this scope
   14 | c=a%b;
      | ^
Language: C++

#include<stdio.h>

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

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

int main(){
  int a, b;
  while(scanf("%d%d", &x, &y) != EOF){
    printf("%d %d\n", gcd(x, y), lcm(x, y));
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:24: error: 'x' was not declared in this scope
   14 |   while(scanf("%d%d", &x, &y) != EOF){
      |                        ^
a.cc:14:28: error: 'y' was not declared in this scope
   14 |   while(scanf("%d%d", &x, &y) != EOF){
      |                            ^
Language: C++

void printFunc(int a,int b,int c,int d,int e,int f);
long gcd(long a,long b);

int main(){
  long a = 0,b = 0;

  while(fscanf(stdin,"%d %d",&a,&b) != EOF){
    printf("%d %d",gcd(a,b),a*b/gcd(a,b));
  }

  return 0;
}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: 'stdin' was not declared in this scope
    7 |   while(fscanf(stdin,"%d %d",&a,&b) != EOF){
      |                ^~~~~
a.cc:1:1: note: 'stdin' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | void printFunc(int a,int b,int c,int d,int e,int f);
a.cc:7:9: error: 'fscanf' was not declared in this scope
    7 |   while(fscanf(stdin,"%d %d",&a,&b) != EOF){
      |         ^~~~~~
a.cc:7:40: error: 'EOF' was not declared in this scope
    7 |   while(fscanf(stdin,"%d %d",&a,&b) != EOF){
      |                                        ^~~
a.cc:7:40: note: 'EOF' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
a.cc:8:5: error: 'printf' was not declared in this scope
    8 |     printf("%d %d",gcd(a,b),a*b/gcd(a,b));
      |     ^~~~~~
a.cc:8:5: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
a.cc: In function 'long int gcd(long int, long int)':
a.cc:19:8: warning: control reaches end of non-void function [-Wreturn-type]
   19 |     gcd(b,a%b);
      |     ~~~^~~~~~~
Language: C++

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

int main(){

  long long int a,b,c,r,s;

  while(cin >> a >> b){

    s=a*b;

    while(b!=0){

      c=a/b;
      r=a%b;
      a=b;
      b=r;

    }

    cout << a << ' ' << s/a <<  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:9:9: error: 'cin' was not declared in this scope
    9 |   while(cin >> a >> b){
      |         ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include<cstdio>
  +++ |+#include <iostream>
    3 | using namespace std;
a.cc:22:5: error: 'cout' was not declared in this scope
   22 |     cout << a << ' ' << s/a <<  endl;
      |     ^~~~
a.cc:22:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:22:33: error: 'endl' was not declared in this scope
   22 |     cout << a << ' ' << s/a <<  endl;
      |                                 ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include<cstdio>
  +++ |+#include <ostream>
    3 | using namespace std;
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int getLCM(int, int);
int getGCD(int, int, int);

int main(int argc, char *argv[]) {
  int x, y;
  vector<int> result;

  while (cin >> x >> y) {
    int lcm = getLCM(x, y);
    int gcd = getGCD(x, y, lcm);
    result.push_back(lcm);
    result.push_back(gcd);
  }
  for (int i = 0; i < result.size()/2; i++)
    cout << result[i*2] << ' ' << result[i*2+1] << endl;
  return 0;
}

int getLCM(int x, int y) {
  int tmp;

  if (x < y) {
    tmp = y;
    y = x; 
    x = tmp;
  }
  while (x % y != 0) {
    tmp = x % y;
    x = y;
    y = tmp;
  }
  return y;
}

Compiler output:
/usr/bin/ld: /tmp/ccPD8x1R.o: in function `main':
a.cc:(.text+0x3e): undefined reference to `getGCD(int, int, int)'
collect2: error: ld returned 1 exit status
Language: C++

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner cin = new Scanner(System.in);
		int a,b;
		while(true){
			a = cin.nextInt();
			b = cin.nextInt();
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		}
	}

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

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

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:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~