2011年10月21日
摘要: 有不限数目的1、5、10、20、50面额的纸币,有多少种方法凑出100元? 笨办法:暴力枚举~ 1 #include<iostream> 2 #include<cstring> 3 using namespace std; 4 5 const int Len = 5; 6 int ans = 0; 7 int m[Len] = {50, 20, 10, 5, 1}; 8 int total[Len] = {2, 5, 10, 20, 100}; 9 int n[Len];10 int sum = 100;11 12 void GetNum(int m[], int n[ 阅读全文
posted @ 2011-10-21 14:44 白草黒尖 阅读(300) 评论(0) 推荐(0) 编辑