50,528
社区成员
发帖
与我相关
我的任务
分享
while(r!=0)
{
int tmp=max;
max=min;
min=tmp%min;
r=min;
}
System.out.println("做大公约数为:"+max);
p=m*n/max;
System.out.println("最小公倍数为:"+p);
public long gcd2(long M,long N){
while(N!=0){
long rem=M%N;
M=N;
N=rem;
}
return M;
}