package com.zuoye.test;//百鸡百钱5文钱可以买一只公鸡,3文钱可以买一只母鸡,1文钱可以买3只雏鸡.public class Baiji { public static void main(String[] args) { int a; int b; int c; int sum; for(a=0;a<21;a++) { for(b=0;b<30;b++) { for(c=0;c<100;c++) { sum=5*a+3*b+c/3; if(sum==100&am
//百钱买百鸡public class baiqianbaiji { static void BQBJ(int m,int n)//m为钱的总数,n为鸡数 { int z; for(int x = 0;x <= n;x++){ for(int y = 0;y <= n; y++){ z = n- x - y; if(z >= 0 && z % 3 == 0 && m == x * 5 + y * 3 + z / 3) System.out.printf(&