#include<iostream>
using namespace std;intgcd(int m,int n){
if(m<n){
int t=m;
m=n;
n=t;}while(m%n!=0){
//同第三章15题,辗转相除int t=m;
m=n;
n=t%n;}return n;}intlcm(int m,int n){
return m*n/gcd(m,n);}intmain(){
int m,n;
cout<<"input two integers:"<<endl;
cin>>m>>n;
cout<<"the greatest common divisor is: "<<gcd(m,n)<<endl;
cout<<"the least common multiple is: "<<lcm(m,n)<<endl;return0;}