Current location - Education and Training Encyclopedia - University rankings - The homework "selling ducks" in the third week of "C language programming (Part II)" of Beijing Institute of Technology can't raise traffic.
The homework "selling ducks" in the third week of "C language programming (Part II)" of Beijing Institute of Technology can't raise traffic.
# include & ltstdio.h & gt

void main()

{

Int chicken, duck and rabbit;

int footSum,answerNum

for(chicken= 1,answer num = 0; Chicken < = a; Chicken++)

{

for(duck = 1; Duck < = a; duck++)

{

Rabbit = A- chicken-duck;

FootSum = chicken * 2+ duck * 2+ rabbit * 4;

if(footSum==B)

Printf ("Answer %d: number of chickens in cages% d \ tNumber of ducks in cages% d \ tNumber of rabbits in cages %d\n ",answer num);

}