标签:algorithm
/* * hdu 最小公倍数 * date 2014/5/13 * state AC */ #include <iostream> using namespace std; int gcd(int x,int y) { while(x!=y) { if(x>y)x=x-y; else y=y-x; } return x; } int main() { //cout << "Hello world!" << endl; int a,b; while(scanf("%d%d",&a,&b)==2) { cout<<a/gcd(a,b)*b<<endl; } return 0; }
标签:algorithm
原文地址:http://blog.csdn.net/greenapple_shan/article/details/25734981