public static int jishu(){
int [] array = {0,1,2,3,4,5};
int jijiao=0,tujiao;
for(int i=0 ;i<array.length;i++){
if(array[i] == 0) continue;
for(int j=0 ;j<array.length;j++){
if(i == j) continue;
for(int k=0 ;k<array.length;k++){
if(i == k || j==k) continue;
jijiao = i*100+j*10+k;
tujiao = jijiao *2;
if(jijiao%2 == 0 && jijiao/2 == tujiao/4 ){
System.out.println("鸡兔各"+jijiao/2+"只,鸡脚"+jijiao+"兔脚"+tujiao);
return jijiao;
}
}
}
}
return jijiao;
}
public static void main(String[] args) {
jishu();
}
希望有帮助