百钱百鸡

公鸡5,母鸡3,小鸡1/3

一共一百只,一共一百块

 

public class Test {
public static void main(String[] args) {
for (int x = 0; x <= 20; x++) {
for (int y = 0; y <= 33; y++) {
int z = 100 - x - y;
if (z % 3 == 0 && 5 * x + 3 * y + z / 3 == 100) {
System.out.println(x + "," + y + "," + z);
}
}
}
}
}
posted @ 2022-01-15 17:29  大灰狼21  阅读(180)  评论(0)    收藏  举报