criyle/codenet-compile-errors huggingface dataset:
Language: Java

import java.util.Scanner;

public class Main0005 {

	public static void main(String[] args) {
		long n, m, k;

		Scanner in = new Scanner(System.in);

		while (true) {
			n = in.nextInt();
			m = in.nextInt();

			k=Math.max(n, m);
			m=Math.min(n, m);
			n=k;
			
			System.out.println(gcd(n, m) + " "
					+ (n * m) / gcd(n, m));
		}
	}

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

		if(n-m>0) return gcd(m, n-m);
		else return n;
		
	}

}

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

import java.util.Scanner;

public class GCDandLCM {

	private GCDandLCM() {
		try(Scanner in = new Scanner(System.in)){
			long a,b;
			while(in.hasNext()){
				a = in.nextInt();
				b = in.nextInt();
				System.out.println(gcd(a,b)+" "+lcm(a,b));
			}
		}
	}


	public final long gcd(long a, long b) {
		if(a==b){
			return a;
		} else if(a>b) {
			return gcd(b,a-b);
		} else {
			return gcd(a,b-a);
		}
	}

	public final long lcm(long a, long b) {
		return a*b/gcd(a,b);
	}


	public static void main(String[] args) {
		new GCDandLCM();
	}

}

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

import java.util.Scanner;

public class GCDandLCM {

	private GCDandLCM() {
		Scanner in = new Scanner(System.in)
		long a,b;
		while(in.hasNext()){
			a = in.nextInt();
			b = in.nextInt();
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		}
		
	}


	public final long gcd(long a, long b) {
		if(a==b){
			return a;
		} else if(a>b) {
			return gcd(b,a-b);
		} else {
			return gcd(a,b-a);
		}
	}

	public final long lcm(long a, long b) {
		return a*b/gcd(a,b);
	}


	public static void main(String[] args) {
		new GCDandLCM();
	}

}

Compiler output:
Main.java:6: error: ';' expected
		Scanner in = new Scanner(System.in)
		                                   ^
1 error
Language: Java

import java.util.Scanner;

public class GCDandLCM {

	private GCDandLCM() {
	        Scanner in = new Scanner(System.in);
		long a,b;
		while(in.hasNext()){
			a = in.nextInt();
			b = in.nextInt();
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		}
	}

	/**
	 * 最大公約数の計算
	 * @param a
	 * @param b
	 * @return
	 */
	public final long gcd(long a, long b) {
		if(a==b){
			return a;
		} else if(a>b) {
			return gcd(b,a-b);
		} else {
			return gcd(a,b-a);
		}
	}

	/**
	 * 最小公倍数の計算
	 * @param a
	 * @param b
	 * @return
	 */
	public final long lcm(long a, long b) {
		return a*b/gcd(a,b);
	}


	public static void main(String[] args) {
		new GCDandLCM();
	}

}

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

import java.util.Scanner;

public class GCDandLCM {

	private GCDandLCM() {
		Scanner in = new Scanner(System.in);
		long a,b;
		while(in.hasNext()){
			a = in.nextInt();
			b = in.nextInt();
			System.out.println(gcd(a,b)+" "+lcm(a,b));
		}
	}

	public long gcd(long a, long b) {
		if(a==b){
			return a;
		} else if(a>b) {
			return gcd(b,a-b);
		} else {
			return gcd(a,b-a);
		}
	}

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

	public static void main(String[] args) {
		new GCDandLCM();
	}
}

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

import java.util.Scanner;

public class aoj0005{
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
			while(sc.hasNext())
			{
				long a = sc.nextLong();
				long b = sc.nextLong();
				long d = a * b;
				long r = 0;
					for(;a%b != 0;)
					{
						r = a % b;
						a=b;
						b=r;
					}
						System.out.println(r +" "+ (d/r));
			}
	}
}

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

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <queue>
#include <cstring>
#include <cmath>

#define cl(x) memset(x , 0 , sizeof(x))
typedef long long ll;
using namespace std;
const int N = 100010;
int n,m,k;
int w[N];

int t[N];
int pre[N];

void sol() {
    scanf("%d%d%d",&n,&m,&k);
    for(int i = 1 ; i <= n; ++i) {
        scanf("%d",&w[i]);
    }
    for(int i = 1 ; i <= m ; ++i) {
        scanf("%d",&t[i]);
    }
    int pos = 1;
    pre[1] = 1;
    int sum = 0;
    for(int i = 2; i <= n ; ++i) {
        sum += w[i];
        while(sum > k) {
            pos ++;
            sum -= w[pos];
        }
        pre[i] = pos;
    }
    for(int i = 1 ;i <= n; ++i) {
    	pre[i] --;
    	//pre[i] = max(1 , pre[i]);
    }
    int preid = 0;
    int ans = 0;

	t[0] = 0;
    for(int i = 1 ; i <= m; ++i) {
        int tmp = t[i] - t[i-1] - 1;
        int cur = preid + tmp;

        if(cur >= n ) {
            ans += n - preid;
            break;
        }
        ans += tmp;
        preid = pre[cur];
    }
    printf("%d\n",ans);
}
int main() {
    freopen("input.txt","r",stdin);
    sol();
    return 0;
}

Compiler output:
Main.java:1: error: illegal character: '#'
#include <iostream>
^
Main.java:2: error: illegal character: '#'
#include <cstdio>
^
Main.java:3: error: illegal character: '#'
#include <algorithm>
^
Main.java:4: error: illegal character: '#'
#include <cstdlib>
^
Main.java:5: error: illegal character: '#'
#include <queue>
^
Main.java:6: error: illegal character: '#'
#include <cstring>
^
Main.java:7: error: illegal character: '#'
#include <cmath>
^
Main.java:9: error: illegal character: '#'
#define cl(x) memset(x , 0 , sizeof(x))
^
Main.java:11: error: class, interface, enum, or record expected
using namespace std;
^
Main.java:12: error: class, interface, enum, or record expected
const int N = 100010;
^
Main.java:13: error: class, interface, enum, or record expected
int n,m,k;
^
Main.java:14: error: class, interface, enum, or record expected
int w[N];
^
Main.java:16: error: class, interface, enum, or record expected
int t[N];
^
Main.java:17: error: class, interface, enum, or record expected
int pre[N];
^
Main.java:19: error: unnamed classes are a preview feature and are disabled by default.
void sol() {
^
  (use --enable-preview to enable unnamed classes)
Main.java:20: error: illegal start of expression
    scanf("%d%d%d",&n,&m,&k);
                   ^
Main.java:20: error: illegal start of expression
    scanf("%d%d%d",&n,&m,&k);
                      ^
Main.java:20: error: illegal start of expression
    scanf("%d%d%d",&n,&m,&k);
                         ^
Main.java:22: error: illegal start of expression
        scanf("%d",&w[i]);
                   ^
Main.java:25: error: illegal start of expression
        scanf("%d",&t[i]);
                   ^
20 errors
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws IOException{

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		while(true){
			String str =  br.readLine();
			if(str == null || str == "")
			String[] str1Ary = str.split(" ");
			long a = Integer.parseInt(str1Ary[0]);
			long b = Integer.parseInt(str1Ary[1]);
			System.out.println(getGCD(a, b) + " " + getLCM(a, b));
		}
		
	}

	private static long getGCD(long a, long b){
		long r;
		while ((r = a % b) != 0) {
			a = b;
			b = r;
		}
		return b;
	}

	private static long getLCM(long a, long b) {
		return a * b / getGCD(a, b);
	}
}

Compiler output:
Main.java:14: error: variable declaration not allowed here
			String[] str1Ary = str.split(" ");
			         ^
1 error
Language: Java

#include <iostream>
using namespace std;

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

long lcm(long m, long n) {
    if(m == 0 || n == 0) return(0);
    return((m * n) / gcd(m, n));
}

int main(void) {
    long a, b;
    while(scanf("%ld %ld", &a, &b) != EOF) {
        cout << gcd(a, b) << " " << lcm(a, b) << endl;
    }
    return(0);
}

Compiler output:
Main.java:1: error: illegal character: '#'
#include <iostream>
^
Main.java:1: error: class, interface, enum, or record expected
#include <iostream>
         ^
Main.java:4: error: unnamed classes are a preview feature and are disabled by default.
long gcd(long a, long b) {
^
  (use --enable-preview to enable unnamed classes)
Main.java:17: error: not a statement
        cout << gcd(a, b) << " " << lcm(a, b) << endl;
                                              ^
Main.java:14: error: <identifier> expected
int main(void) {
             ^
Main.java:16: error: illegal start of expression
    while(scanf("%ld %ld", &a, &b) != EOF) {
                           ^
Main.java:16: error: illegal start of expression
    while(scanf("%ld %ld", &a, &b) != EOF) {
                               ^
7 errors
Language: Java



import java.io.IOException;
import java.util.Scanner;


public class GCD_and_LCM {

	public static void main(String[] args) throws IOException {
		Scanner scan = new Scanner(System.in);
		while (scan.hasNext()) {
			long a = scan.nextLong();
			long b = scan.nextLong();
			long gcd = divide(a, b);
			
			long lcm = a * b / gcd;
			System.out.println(gcd + " " + lcm);

		}
	}

	public static long divide(long a, long b) {
		long r;
		if (a < b) {
			long temp = b;
			b = a;
			a = temp;
		}
		r = a % b;

		return r == 0 ? b : divide(b, r);
	}

}

Compiler output:
Main.java:7: error: class GCD_and_LCM is public, should be declared in a file named GCD_and_LCM.java
public class GCD_and_LCM {
       ^
1 error
Language: C

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

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

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

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



Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

#include<bits/stdc++.h>
using namespace std;
int n,m;
int gcd(int a,int b){
    return b?gcd(b,a%b):a;
}
int main()
{
    while(cin>>n>>m){
        int d=gcd(n,m);
        int lcm=n/d*m;
        cout<<d<<" "<<lcm<<endl;
    }
    return 0;
}



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

#include<iostream>
#include<cstdio>
using namespace std;
int a,b,temp;

int main()
{
	while(cin>>a>>b)
	{
		temp=0;
		if(a>b)
		{
			for(int i=1;i<=a;i++)
			{
				if(a%i==0&&b%i==0)
				{
					temp=i;
				}
			}
			cout<<temp<<" ";
			for(int i=a;;i++)
			{
				if(i%a==0&&i%b==0)
				{
					cout<<i;
					break;
				}
			}
		}
		else
		{
			for(int i=1;i<=b;i++)
			{
				if(a%i==0&&b%i==0)
				{
					temp=i;
				}
			}
			cout<<temp<<" ";
			for(int i=b;;i++)
			{
				if(i%a==0&&i%b==0)
				{
					cout<<i;
					break;
				}
			}
		}
		cout<<endl;
	}
	return 0;
}




Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

#include <stdio.h>
using namespace std;

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

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

int main() {
	long a, b;
	while (~scanf("%d %d",&a,&b)) {
		if (b > a) {
			int tmp = b;
			b = a;
			a = tmp;
		}
		printf("%d %d\n", gcd(a, b),(long)lcm(a,b));
	}
}


Compiler output:
main.c:2:1: error: unknown type name 'using'
    2 | using namespace std;
      | ^~~~~
main.c:2:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
    2 | using namespace std;
      |                 ^~~
Language: C

#include<stdio.h>

int main(void){
	int a, b, n;
	int i;
	int c, d;	//最大公約数,最小公倍数

	while (scanf("%d %d", &a, &b) != EOF){		//Ctrl+Zが押されるまで繰り返す
		if (a < b){		//a>bになるように入れ替える
			n = a; a = b; b = n;
		}


		for (i = a; i>0; i--){		//最大公約数を求める
			if (a / i == double(a) / double(i)){
				if (b / i == double(b) / double(i)){
					c = i;
					break;
				}
			}
		}
		i = 1;
		while (1){		//最小公倍数を求める
			if (a*i / b == double(a*i) / double(b)){
				d = i;
				break;
			}
			i++;
		}
		printf("%d %d\n", c, a*d);
	}

	return 0;

}

Compiler output:
main.c: In function 'main':
main.c:15:38: error: expected expression before 'double'
   15 |                         if (a / i == double(a) / double(i)){
      |                                      ^~~~~~
main.c:16:46: error: expected expression before 'double'
   16 |                                 if (b / i == double(b) / double(i)){
      |                                              ^~~~~~
main.c:24:40: error: expected expression before 'double'
   24 |                         if (a*i / b == double(a*i) / double(b)){
      |                                        ^~~~~~
Language: C

#include<stdio.h>

int main(void){
	int a, b, n,a1,a2,b1;
	int i;
	int c, d;	//最大公約数,最小公倍数

	while (scanf("%d %d", &a, &b) != EOF){		//Ctrl+Zが押されるまで繰り返す
		if (a < b){		//a>bになるように入れ替える
			n = a; a = b; b = n;
		}


		for (i = a; i>0; i--){		//最大公約数を求める
			a1 = a / i;
			a2 = double(a) / double(i);
			if (a1==a2){
				if (b / i == double(b) / double(i)){
					c = i;
					break;
				}
			}
		}
		i = 1;
		while (1){		//最小公倍数を求める
			if (a*i / b == double(a*i) / double(b)){
				d = i;
				break;
			}
			i++;
		}
		printf("%d %d\n", c, a*d);
	}

	return 0;

}

Compiler output:
main.c: In function 'main':
main.c:16:30: error: expected expression before 'double'
   16 |                         a2 = double(a) / double(i);
      |                              ^~~~~~
main.c:18:46: error: expected expression before 'double'
   18 |                                 if (b / i == double(b) / double(i)){
      |                                              ^~~~~~
main.c:26:40: error: expected expression before 'double'
   26 |                         if (a*i / b == double(a*i) / double(b)){
      |                                        ^~~~~~
Language: C

#include<stdio.h>

int main(void){
	int a, b, n, a1, a2, b1;
	int i;
	int c, d;	//最大公約数,最小公倍数

	while (scanf("%d %d", &a, &b) != EOF){		//Ctrl+Zが押されるまで繰り返す
		if (a < b){		//a>bになるように入れ替える
			n = a; a = b; b = n;
		}


		for (i = a; i>0; i--){		//最大公約数を求める
			a1 = a / i;
			a2 = double(a) / i;
			if (a1 == a2){
				if (b / i == double(b) / double(i)){
					c = i;
					break;
				}
			}
		}
		i = 1;
		while (1){		//最小公倍数を求める
			if (a*i / b == double(a*i) / double(b)){
				d = i;
				break;
			}
			i++;
		}
		printf("%d %d\n", c, a*d);
	}

	return 0;

}

Compiler output:
main.c: In function 'main':
main.c:16:30: error: expected expression before 'double'
   16 |                         a2 = double(a) / i;
      |                              ^~~~~~
main.c:18:46: error: expected expression before 'double'
   18 |                                 if (b / i == double(b) / double(i)){
      |                                              ^~~~~~
main.c:26:40: error: expected expression before 'double'
   26 |                         if (a*i / b == double(a*i) / double(b)){
      |                                        ^~~~~~
Language: C

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

Compiler output:
main.c:2:1: warning: data definition has no type or storage class
    2 | a;main(b){while(scanf("%d%d",&a,&b))printf("%d %d\n",__gcd(a,b),__gcd(a,b)*b);
      | ^
main.c:2:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
main.c:2:3: error: return type defaults to 'int' [-Wimplicit-int]
    2 | a;main(b){while(scanf("%d%d",&a,&b))printf("%d %d\n",__gcd(a,b),__gcd(a,b)*b);
      |   ^~~~
main.c: In function 'main':
main.c:2:3: error: type of 'b' defaults to 'int' [-Wimplicit-int]
main.c:2:54: error: implicit declaration of function '__gcd' [-Wimplicit-function-declaration]
    2 | a;main(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(){
  
  long long a,b,c,d,e,ans2,ans1,i; 
  
  while(scanf("%lld %lld",&a,&b)!=EOF){
    
    if(b>a){
      c=a;
      a=b;
      b=c;
    }
    
    for(i=a;i<=a*b;i++){
      if(i%a==0 && i%b==0){
	ans2=i;
	break;
      }
    }
    
    while(1){
      c=a%b;
       a=b;
       b=c;
       if(c==0){
	 break;
       }
    }
     ans1=a;
     
     printf("%lld %lld\n",ans1,ans2);
     a=b=c=ans1=0;
     ans2=0;
  }
  
  return 0;
}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
Language: C

#include <stdio.h>
#define D(fmt,...) fprintf(stderr, fmt, ##__VA_ARGS__)
#define P(fmt,...) fprintf(stdout, fmt, ##__VA_ARGS__)

int gcd (int a, int b) {
  int min = a < b ? a : b;
  int gcd  = 1;
  int i = 0;
  for (i = 1; i < min; i++) {
    if (a % i == 0 && b % i == 0) {
      a /= i; b /= i;
      gcd *= i;
    }
  }
  return gcd;
}

int lcm (int a, int b, int g) {
  int lcm = 0;
  int min = a < b ? a : b;
  int x = a / g;
  int y = b / g;
  return g * x * y;
}
		      
int main (int ac, char **av)
{
  while(feof(stdin) == 0) {
    int a, b = 0;
    fscanf(stdin, "%d %d\n", &a, &b);
    int g = gcd(a, b);
    P("%d %d\n", g, l

Compiler output:
main.c: In function 'main':
main.c:32:22: error: unterminated argument list invoking macro "P"
   32 |     P("%d %d\n", g, l
      |                      ^
main.c:32:5: error: 'P' undeclared (first use in this function)
   32 |     P("%d %d\n", g, l
      |     ^
main.c:32:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:32:6: error: expected ';' at end of input
   32 |     P("%d %d\n", g, l
      |      ^
      |      ;
main.c:32:5: error: expected declaration or statement at end of input
   32 |     P("%d %d\n", g, l
      |     ^
main.c:32:5: error: expected declaration or statement at end of input
Language: C

#include <stdio.h>

int rest(int x, int y);
int get_gcd(int x, int y);

int main(void)
{
	int x, y, gcd, lcm;
	while(scanf("%d %d", &x, &y)==2)
	{
		gcd = get_gcd(x, y);
		
		lcm = x * y gcd;
		
		printf("%d %d", gcd, lcm);
	}
	return 0;
}

int get_gcd(int x, int y)
{
	if(x<y)
	{
		y = y % x;
	}
	while(x >= 1 && y >= 1)
	{
		x = x % y;
		if(x == 0)
			break;
		
		y = y % x;
	}

	return (x + y);
}

Compiler output:
main.c: In function 'main':
main.c:13:28: error: expected ';' before 'gcd'
   13 |                 lcm = x * y gcd;
      |                            ^~~~
      |                            ;
Language: C

#include <stdio.h>

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

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

int gcd(int m, int n){
	if(m == 0 || n == 0) return 0;
	while(n != m){
		if (m > n) m -= n;
		else n -= m;
	}
	return n;
}

int lcm(int m, int n){
	return m / gcd(m, n) * n;
}

Compiler output:
main.c: In function 'main':
main.c:9:34: error: implicit declaration of function 'gcm'; did you mean 'lcm'? [-Wimplicit-function-declaration]
    9 |                 printf("%d %d\n",gcm(a,b),lcm(a,b));
      |                                  ^~~
      |                                  lcm
Language: C

int main(){
int a,b,g,l,i;
while (scanf("%d %d",&a,&b) !=EOF) {
g=1;
if (a<b) {i=a; a=b; b=i;}
for (i=1;i<=a;i++) {
if (a%i==0 && b%i==0) {g=i;}
}

for (i=a*b;i>=a;i--) {
if (i%a==0 && i%b==0) {l=i;}
}

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

Compiler output:
main.c: In function 'main':
main.c:3:8: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    3 | while (scanf("%d %d",&a,&b) !=EOF) {
      |        ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main(){
main.c:3:8: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    3 | while (scanf("%d %d",&a,&b) !=EOF) {
      |        ^~~~~
main.c:3:8: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:3:31: error: 'EOF' undeclared (first use in this function)
    3 | while (scanf("%d %d",&a,&b) !=EOF) {
      |                               ^~~
main.c:3:31: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:3:31: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:1: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   14 | printf("%d %d\n",g,l);
      | ^~~~~~
main.c:14:1: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:14:1: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:14:1: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include<stdio.h>
int main(void){
  int a,b,i,gcm=1,lcm=1;
   while(scanf("%d %d",&a,&b) != EOF){
      gcm=1;lcm=1;
      for(i=2;(i<=a)||(i<=b);i++){
	if(a%i==0&&b%i==0){
	  gcm*=i;
	}
	if(a%i==0||b%i==0){
	  lcm*=i;
	}
	if(a%i==0){
	  a=a/i;
	}
	if(b%i==0){
	  b=b/i;
	}
	if(a%i==0||b%i==0){
	  i=2;
	}
      }
      printf("%d %d",gcm,lcm);
      /*  }*/
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:26:1: error: expected declaration or statement at end of input
   26 | }
      | ^
Language: C

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

int main(void){

int a,b,c,d,e;
while(scanf("%d %d",&a,&b) != EOF){
	c = a*b;
	while(1){
		fmax(a,b) = fmax(a,b)%fmin(a,b);
		if(fmin(a,b) == 0){
			break;
		}
	}
	printf("%d %d",fmax(a,b),c/fmax(a,b));
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:38: error: invalid operands to binary % (have 'double' and 'double')
   10 |                 fmax(a,b) = fmax(a,b)%fmin(a,b);
      |                             ~~~~~~~~~^~~~~~~~~~
      |                             |         |
      |                             double    double
Language: C

#include <iostream>
#include<math.h>
using namespace std;

int main()
{
    long long int flag,a1,b1,t,k,a,b;
    while(cin>>a>>b){
    	a1=a,b1=b;
		if(a<b)
			t=a,a=b,b=t;
		for(;;){
			k=a%b;
			if(k==0)
				break;
			flag=k;
			a=b;
			b=k;
		}
		cout<<flag<<" "<<(a1/flag)*b1<<endl;
    }
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

#include <stdio.h>

int gcd(int a, int b){

if(a<b){
int temp=a;
a=b;
b=temp;
}

int c;

do{
c=a%b;
a=b;
b=c;
}while(c!=0);

return a;
}

int lcm(int a, int b){

int c, va, vb;

c=gcm(a,b);
va=a/c;
vb=b/c;

return c*va*vb;
}

int main(void){

int a, b;

while(scanf("%d %d", &a, &b)!=-1){

printf("%d %d", gcd(a,b), lcm(a,b));

}

return 0;
}

Compiler output:
main.c: In function 'lcm':
main.c:26:3: error: implicit declaration of function 'gcm'; did you mean 'lcm'? [-Wimplicit-function-declaration]
   26 | c=gcm(a,b);
      |   ^~~
      |   lcm
Language: C

#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>

int gcd(int a, b) {
	if(a == 0 || b == 0) return 0;
	while(a != b) {
		if(a > b) a -= b;
		else b -= a;
	}
	return a;
}

int lcm(int a, int b) {
	if(a == 0 || b == 0) return 0;
	return (a / gcd(a, b)) * b;
}

int main() {
	int a, b;

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

Compiler output:
main.c:7:16: error: unknown type name 'b'
    7 | int gcd(int a, b) {
      |                ^
main.c: In function 'lcm':
main.c:18:21: error: implicit declaration of function 'gcd' [-Wimplicit-function-declaration]
   18 |         return (a / gcd(a, b)) * b;
      |                     ^~~
Language: C

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

int gcd(int a, b) {
	if(a == 0 || b == 0) return 0;
	while(a != b) {
		if(a > b) a -= b;
		else b -= a;
	}
	return a;
}

int lcm(int a, int b) {
	if(a == 0 || b == 0) return 0;
	return (a / gcd(a, b)) * b;
}

int main() {
	int a, b;

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

Compiler output:
main.c:5:16: error: unknown type name 'b'
    5 | int gcd(int a, b) {
      |                ^
main.c: In function 'lcm':
main.c:16:21: error: implicit declaration of function 'gcd' [-Wimplicit-function-declaration]
   16 |         return (a / gcd(a, b)) * b;
      |                     ^~~
Language: C

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

unsigned long gcd(unsigned long a, unsigned long b) {
  if(a == 0 || b == 0) return 0;
  while(a != b) {
    if(a > b) a -= b;
    else b -= a;
  }
  return a;
}

unsigned long lcm(unsigned long a, unsigned long b) {
  if(a == 0 || b == 0) return 0;
  return (a / gcd(a, b)) * b;
}

unsigned long main() {
  unsigned long a, b;

  while(scanf("%d %d", &a, &b) != EOF) {
    prunsigned longf("%d %d\n", gcd(a, b), lcm(a, b));
  }
}
~     

Compiler output:
main.c: In function 'main':
main.c:23:5: error: unknown type name 'prunsigned'; did you mean 'unsigned'?
   23 |     prunsigned longf("%d %d\n", gcd(a, b), lcm(a, b));
      |     ^~~~~~~~~~
      |     unsigned
main.c:23:22: error: expected declaration specifiers or '...' before string constant
   23 |     prunsigned longf("%d %d\n", gcd(a, b), lcm(a, b));
      |                      ^~~~~~~~~
main.c:23:33: error: expected declaration specifiers or '...' before 'gcd'
   23 |     prunsigned longf("%d %d\n", gcd(a, b), lcm(a, b));
      |                                 ^~~
main.c:23:44: error: expected declaration specifiers or '...' before 'lcm'
   23 |     prunsigned longf("%d %d\n", gcd(a, b), lcm(a, b));
      |                                            ^~~
main.c: At top level:
main.c:26:1: error: expected identifier or '(' before '~' token
   26 | ~
      | ^
Language: C

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

unsigned long gcd(unsigned long a, unsigned long b) {
	if(a == 0 || b == 0) return 0;
	while(a != b) {
		if(a > b) a -= b;
		else b -= a;
	}
	return a;
}

unsigned long lcm(unsigned long a, unsigned long b) {
	if(a == 0 || b == 0) return 0;
	return (a / gcd(a, b)) * b;
}

int main() {
	unsigned long a, b;

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

Compiler output:
main.c: In function 'main':
main.c:24:9: error: expected declaration or statement at end of input
   24 |         }
      |         ^
Language: C

#include <stdio.h>
#include <conio.h>

void main()
{
    long long int  num1, num2, gcd, lcm, remainder, numerator, denominator;

    scanf("%lld %lld", &num1,&num2);

    if (num1 > num2)
    {
       numerator = num1;
       denominator = num2;
    }
    else
    {
       numerator = num2;
       denominator = num1;
    }
    remainder = num1 % num2;
    while(remainder !=0)
    {
	 numerator   = denominator;
	 denominator = remainder;
	 remainder   = numerator % denominator;
    }
    gcd = denominator;
    lcm = num1 * num2 / gcd;
    printf("%lld %lld\n",gcd, lcm);
    return 0;
}

Compiler output:
main.c:2:10: fatal error: conio.h: No such file or directory
    2 | #include <conio.h>
      |          ^~~~~~~~~
compilation terminated.
Language: C

#include <stdio.h>

int main(void)
{
  int a,b;
  int tmp;
  int GCD,LCM;
  while(scanf("%d %d",&a,&b)!=EOF)
  {
	if(a>b){tmp=a; a=b; b=tmp;}//sort as a<b	  

	while(1)
	{
	  if(a==0){GCD = b; break;}   	

	  tmp = n; n = m%n; m = tmp; 
    }

	LCM = a*b/GCD;
	printf("%d %d\n",GCD,LCM);
  }
  return 0;  	
}

Compiler output:
main.c: In function 'main':
main.c:16:17: error: 'n' undeclared (first use in this function)
   16 |           tmp = n; n = m%n; m = tmp;
      |                 ^
main.c:16:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:24: error: 'm' undeclared (first use in this function)
   16 |           tmp = n; n = m%n; m = tmp;
      |                        ^
Language: C

#include<iostream>
using namespace std;
long long gcd(long long  a,long long b)
{
    if(b==0) return a;
    else return gcd(b,a%b);
}

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

     cout<<ans<<" "<<a*b/ans<<endl;
    }
    return 0;
 }

Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
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:
main.c: In function 'main':
main.c:6:3: error: 'log' undeclared (first use in this function); did you mean 'ulong'?
    6 |   log long int num1,num2,num;
      |   ^~~
      |   ulong
main.c:6:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:6: error: expected ';' before 'long'
    6 |   log long int num1,num2,num;
      |      ^~~~~
      |      ;
main.c:7:27: error: 'num1' undeclared (first use in this function)
    7 |   while(scanf("%lld %lld",num1,&num2)!=EOF){
      |                           ^~~~
main.c:7:33: error: 'num2' undeclared (first use in this function)
    7 |   while(scanf("%lld %lld",num1,&num2)!=EOF){
      |                                 ^~~~
main.c:8:3: error: 'num' undeclared (first use in this function)
    8 |   num=num1*num2;
      |   ^~~
Language: C

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

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
#include<algorithm>
using namespace std;
int i;
int js(int x,int y)
{
    for(i=1; ;i++)
    {
        if(i%x==0&&i%y==0)
        {
            break;
        }
    }
    return i;
}
main()
{
    int n,k,j,max,min,x,y,t;
    while(~scanf("%d %d",&x,&y))
    {
        max=js(x,y);
        if(x>y)
            {
                t=x;
                x=y;
                y=t;
            }
        while(x!=0)
        {
            t=x;
            x=y%x;
            y=t;

        }
        min=y;
    printf("%d %d\n",min,max);
    }

}

Compiler output:
main.c:2:9: fatal error: algorithm: No such file or directory
    2 | #include<algorithm>
      |         ^~~~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
int text1(int a, int b)
{
	int t = a;
	if (a<b)
	{
		t = b;
		b = a;
		a = t;
	}
	while (a%b)
	{
		a += t;
	}
	return a;
}
int text2(int a, int b)
{
	int t;
	if (a<b)
	{
		t = b;
		b = a;
		a = t;
	}
	while (a%b)
	{
		t = a%b;
		a = b;
		b = t;
	}
	return b;
}
int main()
{
	int a[4];
	for(int i=0;i<4;i+=2)
		scanf("%lld%llu",&a[i],&a[i+1]);
	for( i=0;i<4;i+=2)
		printf("%lld %llu\n",text2(a[i],a[i+1]),text1(a[i],a[i+1]));
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:39:14: error: 'i' undeclared (first use in this function)
   39 |         for( i=0;i<4;i+=2)
      |              ^
main.c:39:14: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

long gcd(long a, long b);
long lcm(long a, long b);

int main(void){
    long a,b;
    long gcd, lcm;

    while(1){
        a = -1;
        scanf("%ld %ld", &a, &b);
        if(a == -1)break;

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

        printf("%ld %ld\n", gcd, lcm);
        
    }

    return 0;
}

long gcd(long a, long b) {
  long v0 = a, v1 = b, v2 = a % b;
  while (v2 != 0) {
    v0 = v1;
    v1 = v2;
    v2 = v0 % v1;
  };
  return v1;
}

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

Compiler output:
main.c: In function 'main':
main.c:16:15: error: called object 'gcd' is not a function or function pointer
   16 |         gcd = gcd(a, b);
      |               ^~~
main.c:9:10: note: declared here
    9 |     long gcd, lcm;
      |          ^~~
main.c:17:15: error: called object 'lcm' is not a function or function pointer
   17 |         lcm = lcm(a, b);
      |               ^~~
main.c:9:15: note: declared here
    9 |     long gcd, lcm;
      |               ^~~
Language: C

#include <stdio.h>
int main(){
	int a, b ca, cb ,i;
	while(scanf("%d%d",&a,&b) != EOF){
		ca = a;
		cb = b;
		while(1){
			if(ca > cb) ca = ca - cb;
			if(cb > ca) cb = cb - ca;
			if(ca == cb) break;
		}
		i = (a / ca) * b;
		printf("%d %d\n",ca, i );
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:3:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'ca'
    3 |         int a, b ca, cb ,i;
      |                  ^~
main.c:4:32: error: 'b' undeclared (first use in this function)
    4 |         while(scanf("%d%d",&a,&b) != EOF){
      |                                ^
main.c:4:32: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:17: error: 'ca' undeclared (first use in this function); did you mean 'a'?
    5 |                 ca = a;
      |                 ^~
      |                 a
main.c:6:17: error: 'cb' undeclared (first use in this function)
    6 |                 cb = b;
      |                 ^~
main.c:12:17: error: 'i' undeclared (first use in this function)
   12 |                 i = (a / ca) * b;
      |                 ^
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:13:38: error: invalid operands to binary / (have 'int *' and 'int')
   13 |                 printf("%d%d\n",&g,&l/g);
      |                                    ~~^
      |                                    |
      |                                    int *
Language: C

#include<stdio.h>
int main(void){
	int a,b,c,d,e;
	int g,l,r;
	while(scanf("%d%d",&d,&e)==2){
		l=d*e;
		if(d!=e){
		
		a=d>e?d:e;
		b=d>e?e:d;
		while(a%b!=0){
			c=b;
			b=a%b;
			a=c;
		}
		g=b;
		}
		else {
			g=d;
			
		printf("%d %d\n",g,l/g);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:24:1: error: expected declaration or statement at end of input
   24 | }
      | ^
Language: C

#include<stdio.h>
int main(void){
	int x,y,i;
	while(scanf("%d%d",&x,&y)!=EOF){
		i=2;
		if(x%2!=0&&y%2!=0){i=3;
		for(;;i+=2){if(x%i==0&&y%i==0)break;}]
		printf("%d %d\n",i,x*y/i);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:54: error: expected statement before ']' token
    7 |                 for(;;i+=2){if(x%i==0&&y%i==0)break;}]
      |                                                      ^
main.c:11:1: error: expected declaration or statement at end of input
   11 | }
      | ^
Language: C

#include <algorithm>
#include <iostream>
#include <typeinfo>

int main() {
  int total_time;
  std::cin >> total_time;

  int min_price;
  std::cin >> min_price;
  int max_profit = std::numeric_limits<int>::min();
  for (auto t = 1; t < total_time; t++) {
    int price;
    std::cin >> price;
    max_profit = std::max(max_profit, price - min_price);
    min_price = std::min(min_price, price);
  }
  std::cout << max_profit << '\n';
  return 0;
}

Compiler output:
main.c:1:10: fatal error: algorithm: No such file or directory
    1 | #include <algorithm>
      |          ^~~~~~~~~~~
compilation terminated.
Language: C

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstring>
#include <string>
#include <set>
#define ll long long
#define x first
#define y second
#define inf 0x3f3f3f3f
//const int N

using namespace std;

ll gcd(ll a,ll b)
{
    while(b!=0)
    {
        ll m=a%b;
        a=b;
        b=m;
    }
    return a;
}



int main()
{   ll a,b;
    while(scanf("%lld%lld",&a,&b)==2)
    {   ll ans=gcd(a,b);
        printf("%lld %lld",ans,a/ans*b);
        printf("\n");
    }
    return 0;
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

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

Compiler output:
main.c: In function 'gcd':
main.c:3:1: error: expected expression before '?' token
    3 | ????????if(x==0)return y;
      | ^
main.c:4:1: error: expected expression before '?' token
    4 | ????????return gcd(y%x,x);
      | ^
main.c: In function 'main':
main.c:7:1: error: expected expression before '?' token
    7 | ????????int i,a,b,c;
      | ^
main.c:8:1: error: expected expression before '?' token
    8 | ????????while(scanf("%d%d",&a,&b)!=EOF){
      | ^
Language: C

#include<stdio.h>

int calc_gcd(int, int);
int calc_lcm(int, int, int);

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

    while(scanf("%d %d", &a, &b) != EOF) {
        if(a <= b) gcd = calc_gcd(a, b); 
        else       gcd = calc_gcd(b, a); 
        lcm = calc_lcm(a, b, gcd);
        printf("%d %d\n", gcd, lcm);
    }   

    return 0;
}

int calc_gcd(int small, int large) {
    if(large % small == 0) return small;

    int gcd = small / 2;
    while(gcd >= 1) {
        if((small % gcd == 0) && (large % gcd == 0)) break;
        gcd--;                                                                                                                                                           
    }   

    return gcd;
}

int calc_lcm(int p, int q, int gcd) {
    return p * q / gcd;
}
~  

Compiler output:
main.c:34:1: error: expected identifier or '(' before '~' token
   34 | ~
      | ^
Language: C

#include<stdio.h>

void swap(int *a,int *b){
	int tmp = *a;
	*a = *b;
	*b = tmp;
}

int main(void){
	int a,b;
	while(scanf("%d %d",&a,&b)!= EOF){
		if(a < b) swap(&a,&b);
		int r = a % b;
		int product = a * b;
		while(r != 0){
			a = b;
			b = r;
			r = a % b;
		}
		printf("%d %d\n",b,product/b);
	}
????????????return 0;
}

Compiler output:
main.c: In function 'main':
main.c:22:1: error: expected expression before '?' token
   22 | ????????????return 0;
      | ^
Language: C

#include<iostream>
using namespace std;
int main() {
    long long a,b,t,GCD,LCM,t2;
    while(cin >> a >> b) {
        t2 = a*b;
        while(b) {
            t = b;
            b = a % b;
            a = t;
        }
        GCD = a;
        LCM = t2/a;
        cout << GCD << " " << LCM << endl;
    }
    return 0;
}

Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

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

using namespace std;

long long gcd(long long a, long long b)
{
	if (b == 0) return a;
	else
		return gcd(b, a%b);
}
//long long lcm(long long a, long long b)
//{
//	return a*b
//}
int main()
{
	long long a, b;
	while (~scanf("%lld%lld", &a, &b))
	{
		long long temp = gcd(a, b);
		printf("%lld %lld\n", temp, a*b / temp);
	}
	return 0;
}

Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
int main()
{
    int a,b,mul;
    printf("Enter number:");
    scanf("%d%d",&a,&b);
    if(0 < a, b ? 2,000,000,000!=EOF)
       if(a,b<=50)
    {
mul=a*b;
        printf("%d",mul);

    }
    else
        printf("Input invalid");
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:37: error: expected ':' before ')' token
    7 |     if(0 < a, b ? 2,000,000,000!=EOF)
      |                                     ^
Language: C

#include<stdio.h>
int main() 
{
	int num1,num2,i,gcd,lcm;
	while(scanf("%d %d\n",&num1,&num2)!=EOF)
	{
		for(i=2;i<=num1&&i<=num2;i++)
		{
			if(num1%i==0&&num2%i==0)
			gcd=i;
		} 
		lcm=(num1×num2)/gcd;
		printf("%d %d\n",gcd,lcm);
	} 
	return 0;
} 

Compiler output:
main.c: In function 'main':
main.c:12:26: error: stray '\303' in program
   12 |                 lcm=(num1<U+00D7>num2)/gcd;
      |                          ^~~~~~~~
main.c:12:26: error: expected ')' before 'num2'
   12 |                 lcm=(num1×num2)/gcd;
      |                     ~    ^~~~~
      |                          )
Language: C

#include<stdio.h>

int max(int a, int b){
  return (a > b) ? a : b;
}
int calcGCD(int a, int b){
  int _min, _max, r;
  _max = max(a, b);
  _min = min(a, b);
  r = _max % _min;
  while(r != 0){
    _max = _min;
    _min = r;
    r = _max%_min;
  }
  return _min;
}


int calcLCM(int a, int b){
  int GCD, LCM;
  GCD = calcGCD(a, b);
  LCM = a * b / GCD;
  return LCM;
}
int main(){
  int a, b;
  int list[50][2];
  int j = 0;
  while(scanf("%d%d", &a, &b)!=EOF){
    list[j][0] = calcGCD(a, b);
    list[j][1] = calcLCM(a, b);
    j+=1;
  }
  int i;
  for(i=0; i<j; i++){
    printf("%d %d\n", list[i][0], list[i][1]);
  }
  return 0;
}

Compiler output:
main.c: In function 'calcGCD':
main.c:9:10: error: implicit declaration of function 'min' [-Wimplicit-function-declaration]
    9 |   _min = min(a, b);
      |          ^~~
Language: C

#include<stdio.h>

int max(int a, int b){
  return (a > b) ? a : b;
}

int min(int a, int b){
  return (a < b) ? a : b;
}
　
int calcGCD(int a, int b){
  int _min, _max, r;
  _max = max(a, b);
  _min = min(a, b);
  r = _max % _min;
  while(r != 0){
    _max = _min;
    _min = r;
    r = _max%_min;
  }
  return _min;
}


int calcLCM(int a, int b){
  int GCD, LCM;
  GCD = calcGCD(a, b);
  LCM = a * b / GCD;
  return LCM;
}
int main(){
  int a, b;
  int list[50][2];
  int j = 0;
  while(scanf("%d%d", &a, &b)!=EOF){
    list[j][0] = calcGCD(a, b);
    list[j][1] = calcLCM(a, b);
    j+=1;
  }
  int i;
  for(i=0; i<j; i++){
    printf("%d %d\n", list[i][0], list[i][1]);
  }
  return 0;
}

Compiler output:
main.c:10:1: error: stray '\343' in program
   10 | <U+3000>
      | ^~~~~~~~
Language: C

#include <stdio.h>

int main(void){
	long long a, b, gcd, lcm;
	long long i, tmp;
	
	while (scanf("%lld %lld", &a, &b), != EOF){
		if (a > b){
			i = a;
			gcd = b;
			tmp = 1;
		}
		if (b > a){
			i = b;
			gcd = a;
			tmp = 1;
		}
		if (a == b){
			gcd = a;
			tmp = 0;
		}
		while (tmp){
			tmp = i%gcd;
			i = gcd;
			if (tmp) gcd = tmp;
		}
		lcm = a*b/gcd;
		printf("%lld %lld\n", gcd, lcm);
	}
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:44: error: expected expression before '!=' token
    7 |         while (scanf("%lld %lld", &a, &b), != EOF){
      |                                            ^~
Language: C

//
//  main.cpp
//  LearingACM
//
//  Created by Niocle.
//  Copyright ? 2017年 Niocle. All rights reserved.
//

#include <iostream>
#include <string>
#include <cstring>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <map>
#include <set>
#include <sstream>
using namespace std;

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

int main(int argc, const char * argv[]) {
    long long a,b;
    while(cin>>a>>b){
        long long g=gcd(a,b);
        cout<<g<<' '<<a/g*b<<endl;
    }
    return 0;
}

Compiler output:
main.c:9:10: fatal error: iostream: No such file or directory
    9 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

int main(void)
{
  int a,b,f,s,gcd,lcm,temp;
  
  while(1){
    
    if(scanf("%d %d",&a,&b)==EOF)
      return(0);
  
    if(a<b){
      f=b;s=a;}
    else{
      f=a;s=b;}
    while(f%s!=0){
      
      temp=f%s;
      f=s;
      s=temp;
    }
    gcd=s;
    lcm = a/gcd*b;
    printf("%d %d\n",gcd,lcm);
  }
  return(0);

}
  

Compiler output:
main.c: In function 'main':
main.c:7:8: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    7 |     if(scanf("%d %d",&a,&b)==EOF)
      |        ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main(void)
main.c:7:8: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    7 |     if(scanf("%d %d",&a,&b)==EOF)
      |        ^~~~~
main.c:7:8: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:7:30: error: 'EOF' undeclared (first use in this function)
    7 |     if(scanf("%d %d",&a,&b)==EOF)
      |                              ^~~
main.c:7:30: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:7:30: note: each undeclared identifier is reported only once for each function it appears in
main.c:22:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   22 |     printf("%d %d\n",gcd,lcm);
      |     ^~~~~~
main.c:22:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:22:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:22:5: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include<stdio.h>

int main(void){
int a,b,i=1,gcd,lcm;
while(scanf("%d %d\n",&a,&b) !=EOF){
while(i<=a && i<=b){
if(a%i==0 && b%i==0) gcd=i;
i++;
}
lcm=a*b/gcd;
printf("%d %d\n",gcd,lcm);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:13:1: error: expected declaration or statement at end of input
   13 | }
      | ^
Language: C

#include<stdio.h>

int main(void){
int a,b,c,d,e,lcm;
while(scanf("%d %d\n",&a,&b) !=EOF){
d=a,e=b
if(a<b) c=a,a=b,b=c;
while(a%b!=0){
c=a%b,a=b,b=c;
}
lcm=d*e/b;
printf("%d %d\n",b,lcm);
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:8: error: expected ';' before 'if'
    6 | d=a,e=b
      |        ^
      |        ;
    7 | if(a<b) c=a,a=b,b=c;
      | ~~
Language: C

#include <stdio.h>

int main(void){
int a,b,c,d,gcd,lcf;
while(scanf("%d %d",&a,&b)!=EOF)
{
d=a*b
if(a<b) c=a,a=b,b=c;
while(a%b!=0) c=a%b,a=b,b=c;
gcd=b,lcm=d/gcd;
printf("%d %d",gcd,lcm);
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:6: error: expected ';' before 'if'
    7 | d=a*b
      |      ^
      |      ;
    8 | if(a<b) c=a,a=b,b=c;
      | ~~    
main.c:10:7: error: 'lcm' undeclared (first use in this function); did you mean 'lcf'?
   10 | gcd=b,lcm=d/gcd;
      |       ^~~
      |       lcf
main.c:10:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int main(void){
int a,b,c,d,gcd,lcf;
while(scanf("%d %d",&a,&b)!=EOF)
{
d=a*b;
if(a<b) c=a,a=b,b=c;
while(a%b!=0) c=a%b,a=b,b=c;
gcd=b,lcf=d/gcd;
printf("%d %d",gcd,lcd);
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:20: error: 'lcd' undeclared (first use in this function); did you mean 'lcf'?
   11 | printf("%d %d",gcd,lcd);
      |                    ^~~
      |                    lcf
main.c:11:20: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int getGCD(int a,int b){
	int i,temp,r;
	
	if(a < b){
		temp = a;
		a = b;
		b = temp;
	}
	
        /*
	for(i = a; i > 0 ; i--){
		if(a % i == 0 && b % i == 0)
			return i;
	}*/
  r = a % b;
  while(r!=0){
    a = b;
    b = r;
    r = a % b;

	
	return 0;
}

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

int main(void){
    int a,b;
	
	while(scanf("%d %d", &a, &b) != EOF){
       	
        printf("%d %d\n", getGCD(a, b), getLCM(a, b));
    }
	
	return 0;
}

Compiler output:
main.c: In function 'getGCD':
main.c:45:1: error: expected declaration or statement at end of input
   45 | }
      | ^