Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func main() {
	sc.Split(bufio.ScanLines)
	defer out.Flush()

	for sc.Scan() {
		x, y := nextInts()
		if x < y {
			rep := x
			x, y = y, rep
		}
		gcd := x % y
		lcm := x * y
		for gcd != 0 {
			x, y, gcd = y, gcd, x%y
		}
		fmt.Fprintf(out, "%d %d\n", y, lcm/y)
	}

}

func nextInts() (a, b int) {
	s := strings.Split(sc.Text(), " ")
	ra, _ := strconv.Atoi(s[0])
	rb, _ := strconv.Atoi(s[1])
	a = ra
	b = rb
	return
}

C++: def get_input():
    while True:
        try:
            yield ''.join(raw_input())
        except EOFError:
            break

if __name__ == '__main__':
    a = list(get_input())

for n in a:
    inl=n.split()
    num=inl[0]+inl[1]
    l=list(num)
    time=0
    for i in l:
        time+=1
    print time

C++: #include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string>
#include<algorithm>
#include<vector> 
#include<limits>
#include<numeric>
#include<math.h>
using namespace std;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define in(x) cin >> x
#define out(str) cout << str << endl

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

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

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

C++: #include <iostream>
using namespace std;

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

			if (a > b) {
				for (i = a; i%b; i += a);
				cout << i << endl;
			}
			else {
				for (i = b; i%a; i += b);
				cout << i << endl;
			}
		}
	return 0;
}

C++: #include <stdio.h>

int gcd(int a, int b){
	int r;
	while(b > 0){
		r = a % b;
		a = b;
		b = r;
	}
	return a;
}
int lcm(int a, int b){
	return a / gcd(a, b) * b;
}

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

	return 0;
}

C++: #include <stdio.h>

int gcd_num;

void gcd(int a, int b){
	int tmp;

	if(a < b){
		tmp = a;
		a = b;
		b = tmp;
	}

	tmp = a % b;
	if(tmp == 0){
		printf("%d ", b);
		gcd_num = b;
	}else{
		gcd(b, tmp);
	}
	return;
}

void lcm(int a, int b){
	printf("%d\n", gcd_num * (a / gcd_num) * (b / gcd_num));
}

int main(void){
	int a, b;
	int tmp;

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

C++: /*
 0005-GCD_and_LCM.cpp
 
 http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0005
 */

#include<iostream>
#include<algorithm>

using namespace std;

int main(){
    int a,b;
    while(cin>>a>>b){
        int temp_a = a;
        int temp_b = b;
        while(1){
            int l = max(temp_a,temp_b);
            int r = min(temp_a,temp_b);
            l = l-r;
            if(l==r){
                cout<<l<<" "<<a/l * b/l * l <<endl;
                break;
            }else{
                temp_a = l;
                temp_b = r;
            }
        }
    }
}

C++: #include <iostream>
using namespace std;
int gcd(int,int); //最大公約数
int lcm(int,int); //最小公倍数
int main(){
    int a,b,c,d;
    while (1){
        cin >> a >> b;
        if(cin.eof()){break;}
        cout << gcd(a,b) << " " << lcm(a,b) << endl;
    }
}

int gcd(int a,int b){
    int n;
    if (a>b){
        n=b;
        b=a;
        a=n;
    }
    while(b%a!=0){
        n=b%a;
        b=a;
        a=n;
    }
    return n;
}

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

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;
}

C++: #include<cstdio>
#include<iostream>

using namespace std;

int a, b;
int gcd, lcm;

void GCD(){

	int big, small;

	big = a;
	small = b;

	while (big) {
		if (small > big) swap(big, small);
		big = big % small;
	}
	gcd = small;

}

void LCM() {
	lcm = a / gcd * b;
}




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

		GCD();
		LCM();
		cout << gcd << " " << lcm << endl;
	}
	return 0;
}

C++: #include <iostream>
using namespace std;

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

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

C++: #include <iostream>
using namespace std;

int main() {
	int a,b,c;
	while(cin>>a>>b){
		int g=0,l=0;
		if(a<b){
			c=b;
			b=a;
			a=c;
		}
		while(1){
			int i=1;
			if((i*a)%b==0){
				g=i*a;
			}
			if(g==i*a) break;
			i=i+1;
		}
		
		cout<<a*b/g<<" "<<g<<endl;
	}
	return 0;
}

C++: #include <iostream>


using namespace std;

int main(){
	int a;
	int b;
	int ii = 1;
	cin >> a >> b;
	while (cin >> a >> b){
	for (int i = 0; i <= 2000000000; i++){
		int c = ii / a * a;
		int d = ii / b * b;
		if (ii == c&&ii == d){
			cout << a * b / ii <<  " " <<ii<< endl;
			break;
		}
		else ii++;

	}
	}

	return 0;
}

C++: #include<iostream>
using namespace std;

int main(void){
 
  long num1,num2,mul,gcd,lcm;
  
  while(cin >> num1 >> num2){
    mul = num1 * num2;

    /*GCD*/
    if(num1 >= num2){
      while(num2 != 0){
	gcd = num1 % num2;
	num1 = num2;
	num2 = gcd;
      }
      gcd = num1;
    }else{
      while(num1 != 0){
	gcd = num2 % num1;
	num2 = num1;
	num1 = gcd;
      }
      gcd = num2;
    }

    /*LCM*/
    lcm = mul / gcd;

    /*PRINT*/
    cout << gcd << " " << lcm << endl;      
  }
  return 0;

}

C++: #include<iostream>

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

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

int main(){
    int a,b;
    while(std::cin >> a >> b){
        if(a == -1 or b == -1)  break;
        std::cin >> a >> b;
        std::cout << gcd(a, b) << " " << lcm(a, b)<< std::endl;
    }
    return 0;
}

C++: #include <iostream>
#include <utility>

#define INPUT_FROM_FILE (0)

#if INPUT_FROM_FILE
#include <fstream>
#endif

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

int main(int argc, char **argv){
#if INPUT_FROM_FILE
	std::ifstream ifs("test.txt");
#endif // INPUT_FROM_FILE
	unsigned long a = 0;
	unsigned long b = 0;

#if INPUT_FROM_FILE
	while(ifs >> a >> b){
#else
	while(std::cin >> a >> b){
#endif
		if(a < b){
			std::swap(a, b);
		}
		unsigned long g = gcd(a, b);
		std::cout << g << " " << (a / g) * b  << std::endl;
	}
	return 0;
}

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

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