public class BaiJiBaiQian { public static void main(String[] args) { for (double a = 0;a<=50;a++) { for (double b = 0;b<=100;b++) { for (double c = 0;c<=200;c++) { if (2*a+b+c/2==100) { System.out.println("公"+a+"母"+b+"小"+c); } } } } } }