Java_ money to buy one hundred one hundred chicken

Title: cock 3 pence, 2 pence hens, three chicks 1 penny hundred money one hundred chickens, seeking how much cock, hen, chicken?

public class Work6{
public static void main(String[] args){

// declare variables cock
int gj;

// declare variables hen
int mj;

// declare variables chick
int xj;

Buy // cock up (100/3) 33
for (GJ = 0; GJ <= 33 is; GJ ++) {
// up to buy 50 hens
for (MJ = 0; MJ <= 50; MJ ++) {
// small Buy chicken up 300
for (XJ = 0; XJ <= 300; XJ ++) {
// X + Y + Z = 100; 3x + 2Y + Z / 100. 3 =
IF (GJ + MJ + XJ. 9 == 100 && * + MJ + *. 6 GJ XJ == 300) {
System.out.println (GJ + "," + MJ + "," + XJ);
}
}
}
}
}
}

Guess you like

Origin www.cnblogs.com/a276665092/p/11914168.html