题目链接:http://acm.nefu.edu.cn/JudgeOnline/status.php?problem_id=116&order=1
解题思路:求最小公倍数
#include<stdio.h> long long gcd(long long a,long long b) { if(b==0) return a; else return gcd(b,a%b); } int main() { long long m,n; while(scanf("%lld %lld",&m,&n)!=EOF) { printf("%lld ",m/gcd(m,n)*n); } }