Current location - Training Enrollment Network - Mathematics courses - Ask for help with a math problem of 999 yuan, represented by 99 RMB notes 100 50 10 5 1.
Ask for help with a math problem of 999 yuan, represented by 99 RMB notes 100 50 10 5 1.
By program, enumeration

Additional code:

# include & ltstdio.h & gt

int main()

{

int a,b,c,d,e,s = 0;

{ for(a = 0; a & lt=9; a++)

for(b = 0; b & lt= 19; b++)

for(c = 0; c & lt=99; c++)

for(d = 0; d & lt= 199; d++)

for(e = 0; e & lt=999; e++)

{

if((a * 100+b * 50+c * 10+d * 5+e = = 999)& amp; & amp(a+b+c+d+e==99))

{printf("%d %d %d %d %d \n ",a,b,c,d,e);

s+= 1; }

}}

printf("%d ",s);

}

Additional operation result:

***5 13 solution

Temporary compilation, there may be some omissions, please adopt it.