用100元人民币兑换10元,5元,1元的纸币(每种都要有)共50张,计算有多少种兑换方案

来源:互联网 发布:绝地求生优化 编辑:程序博客网 时间:2024/04/28 12:48
#include<stdio.h>int main(){    int i,j;    int count=0;     for(i=0;i<=20;i++)     for(j=0;j<=50;j++)     if(100-i*5-j*2>=0)     {         printf("1元%3d张  2元%3d张  5元%3d张",100-i*5-j*2,i,j);         count++;         if(count%2==0)         printf("\n");     }printf("\n%d\n",count);    return 0;}

这里写图片描述

阅读全文
0 0
原创粉丝点击