Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
1910 | 莫业祁 | 两个数的最小公倍数 | C++ | Accepted | 0 MS | 264 KB | 330 | 2023-12-02 15:28:18 |
# 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; }