public static int print(int money) {
int nowMoney = 0;
int cock = 0;
int hen = 0;
int chick = 0;
int count = 0;
for (int i = 0; i <=money/5; i++) {
cock = i;
nowMoney = money-i*5;
if (nowMoney >0) {
for (int h = 0; h <=nowMoney/3; h++) {
hen = h;
nowMoney = nowMoney-h*3;
if (nowMoney >0) {
for (int j = 0; j <=nowMoney/1; j++) {
chick = j*3;
if (nowMoney-j*1 == 0) {
System.out.println("公鸡:"+cock+"只 母鸡:"+hen+"只 小鸡"+chick+"只 ");
count++;
}
}
}
}
}
public static int print(int money) {
int nowMoney = 0;
int cock = 0;
int hen = 0;
int chick = 0;
int count = 0;
for (int i = 0; i <=money/5; i++) {
cock = i;
nowMoney = money-i*5;
if (nowMoney >0) {
for (int h = 0; h <=nowMoney/3; h++) {
hen = h;
nowMoney = nowMoney-h*3;
if (nowMoney >0) {
for (int j = 0; j <=nowMoney/1; j++) {
chick = j*3;
if (nowMoney-j*1 == 0) {
System.out.println("公鸡:"+cock+"只 母鸡:"+hen+"只 小鸡"+chick+"只 ");
count++;
}
}
}
}
}