public class Blocks{
public static void main(String[] args){
for (int boy=0;boy<=9;boy++){
for (int girl=0;girl<=12;girl++){
int chil=36-boy-girl;
if((chil%2==0)&&(boy*4+girl*3+chil/2==36)){
System.out.println("男孩搬"+boy+"块");
System.out.println("女孩搬"+girl+"块");
System.out.println("小孩搬"+chil+"块");
System.out.println();
}
}
}
}
}
运行结果: