作者: denghui1010 时间: 2013-7-2 15:10
public class test
{
public static void main(String[] args)
{
int m =12,n=18;
for(int i=1;i<=m*n;i++)
{
if(i%m==0 && i%n==0)
{
System.out.println(i);
break;
}
}
}
} 作者: 谢威 时间: 2013-7-2 15:13
class LowMul {
private int A, B;
public int get(int a, int b) {
for (int i = Math.max(a, b);; i++) {
A = a;
B = b;
if (accept(i)) {
return i;
}
}
}
private boolean accept(int n) {
return n % A == 0 && n % B == 0;
}
public static void main(String[] args) {
LowerCommonMultiple lcm = new LowerCommonMultiple();