http://acm.hdu.edu.cn/showproblem.php?pid=1108
最小公倍数
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 32700 Accepted Submission(s): 18237
10 14
70
<span style="font-size:24px;">#include<iostream> #include<cmath> using namespace std; int main() { long int a,b,m; int i; while(~scanf("%ld%ld",&a,&b)) { if(a>b) m=a; else m=b; for(i=m;i<a*b;i+=m)//i+=m { if(i%a==0&&i%b==0) { break; } } printf("%d\n",i); } return 0; }</span>
原文地址:http://blog.csdn.net/u012766950/article/details/38024271