public class Shuzu6 {
public static void main(String[] args) {
int chook,chook1,chook2;
for(chook=5;chook<=20;chook++) {
for( chook1=3;chook1<=30;chook1++) {
for( chook2=1;chook2<=99;chook2+=3) {
if(chook*5+chook1*3+chook2/3==100) {
if(chook+chook1+chook2==100) {
System.out.println(chook+"只公鸡"+chook1+"只母鸡"+chook2+"只雏鸡");
}
}
}
}
}
}
}
第八章循环进阶
最新推荐文章于 2021-07-27 11:24:52 发布