#include<stdio.h>
int main()
{
int x,fen1,fen2,fen5,count,total;
scanf("%d",&x);
count=0;
for(fen5=x/5;fen5>=1;fen5–)
{
for(fen2=x/2;fen2>=1;fen2–)
{
for(fen1=x;fen1>=1;fen1–)
if(5fen5+2fen2+fen1==x)
{
total=fen1+fen2+fen5;
printf(“fen5:%d, fen2:%d, fen1:%d, total:%d\n”,fen5,fen2,fen1,total);
count++;
}
}
}
printf(“count = %d”,count);
return 0;
}
4-2-4换硬币
最新推荐文章于 2021-09-07 08:32:43 发布