回复 10楼 哈哈哈1234
#include "stdio.h"
int main(void)
{
int count, fen1, fen2, fen5, money;
scanf("%d", &money);
count=0;
for(fen5=money/5;fen5>=1;fen5--){
for (fen2=money/2;fen2>=1;fen2--){
for (fen1=money;fen1>=1;fen1--){
if(fen1+2*fen2+5*fen5==money){
printf("fen5:%d, fen2:%d, fen1:%d, total:%d\n",fen5, fen2, fen1, fen5+fen2+fen1);
count++;
}}}}
/*---------*/
printf("count = %d\n", count);
}