函数代码:
public static int leastMajorityMultiple(int a,int b,int c,int d,int e){
int biaozhi=0;//标志位,判断有多少个数被整除的
int total=0;
int jieguo=0;//用于存放最终结果
total=a*b*c;//这个作为上限,在这种情况下一定有符合条件的数值
for(int i=4;i<total;i++){
if(i%a==0) biaozhi=biaozhi+1;
if(i%b==0) biaozhi=biaozhi+1;
if(i%c==0) biaozhi=biaozhi+1;
if(i%d==0) biaozhi=biaozhi+1;
if(i%e==0) biaozhi=biaozhi+1;
if(biaozhi>2){
jieguo=i;
break;
}
biaozhi=0;
}
return jieguo;
}