Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
2099 邓小龙 两个数的最小公倍数 C++ Accepted 0 MS 268 KB 352 2023-12-09 18:11:23

Tests(10/10):


Code:

# include<iostream> using namespace std; int main(){ int a,b,c=0,temp1=0,temp2=0; cin>>a>>b; if(b>a){ temp1=a; a=b; b=temp1; } temp1=a; temp2=b; while(a%b!=0){ //找最大公约数 c=a%b; a=b; b=c; } cout<<temp1*temp2/b; return 0; }