1 条题解
-
0
C++ :
#include<iostream> #include<cstdlib> using namespace std; int main() { long long m,n,t; cin>>m>>n; long long a=m,b=n; int r=m%n; while(r!=0) { m=n; n=r; r=m%n; } t=(a*b)/n; cout<<t; //system("pause"); return 0; }
Pascal :
program p2692(input,output); var n,m,a,temp,s,b,c:longint; begin readln(n,m); b:=n; c:=m; a:=n mod m; while a<>0 do begin a:=n mod m; n:=m; if (a<>0) then m:=a; end; s:=trunc(b/m)*c; writeln(s); end.
- 1
信息
- ID
- 2378
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- (无)
- 标签
- 递交数
- 0
- 已通过
- 0
- 上传者