Current location - Training Enrollment Network - Mathematics courses - Mathematics major
Mathematics major
# include & ltstdio.h & gt

int main()

{//The correct question is at least 100/7.

int Chu shii = 100/7;

//Add 1 if you can't use it up.

If (100%7)

{ Chu shii = Chu shii+ 1;

}

for(int I = Chu shii; I & lt=20; i++)

{

//Wrong question should be less than or equal to 20- correct question.

for(int j = 0; j & lt= 20-I; j++)

{ if((I * 7-j * 4)& lt; 100)

{printf ("Correct answer %d*7- Wrong answer% d * 4"

Break;

}

if((20-I-j)& lt; 0)

{printf ("20-(%d+%d) =% d, z value is less than 0, so break\n ",i, j, 20-i-j);

Break;

}

if((7*i-4*j)== 100)

{

Printf ("* * * * * * * */n100 fractional algorithm %d, %d\n", i*7, j * 4);

Printf ("correct answer% d+ wrong answer% d+ no answer% d = 20 \ n * * * * * * * * * * * * * * J, 20-I-J);

Break;

}

}

}

Returns 0;

}