标签:
package liu0912; public class Baiji { public static void main(String[] args) { int a,b,c;int i=0; for(a=0;a<=20;a++) { for(b=0;b<=50;b++) { for(c=3;c<=100;c++) if(a+b+c==100&&5*a+3*b+(1/3)*c==100) { System.out.println("公鸡:"+a+"只"+"母鸡"+b+"只"+"小鸡:"+c+"只"); } } } } }
标签:
原文地址:http://www.cnblogs.com/liuyanzeng/p/5882826.html