最大公约数与最小公倍数

#include <stdio.h>

#include <iostream>

#include <algorithm>
using namespace std;

/ run this program using the console pauser or add your own getch, system(“pause”) or input loop /

//最小公倍数: 两整数相乘 / 最大公约数;

int main(int argc, char** argv) {
int fuc(int a,int b);
int a,b;
while(cin>>a>>b)
{

cout<<a*b / fuc(a,b)<<endl;
}

return 0;
}

int fuc(int a,int b) //辗转相除法求最大公约数
{
int c;
int temp;
if(a<b) //使得a>b
{
temp = a;
a = b;
b = temp;
}

c = a % b; //关键步骤
while(c!=0)
{

a = b;
b = c;
c = a % b;
}
return b;

}