5.25打卡

 2.思路设计

 3.程序流程图

 4.代码实现

#include<bits/stdc++.h>
using namespace std;
main()
{
    int x, y, z, count=1;
    printf("可能的兑换方法如下:\n");
    for(x=0;x<=50;x+=10)
        for(y=0;y<=50-x;y+=5)
            for(z=0;z<=50-x-y;z++)
                if(x+y+z == 50)
                {
                    printf(count%3?"%d: 10*%d+5*%d+1*%d\t":"%d:10*%d+5*%d+1*%d\n", count++,x/10,y/5,z);
                }
}

 

5.测试截图

 

posted @ 2023-05-25 11:13  yblll  阅读(21)  评论(0)    收藏  举报