首页 > 代码库 > 递归练习之换零钱方式统计(c/c++)

递归练习之换零钱方式统计(c/c++)

/*********************************************************************************  
 Copyright (C), 1988-1999, drvivermonkey. Co., Ltd.  
 File name:   
 Author: Driver Monkey  
 Version:   
 Mail:bookworepeng@hotmail.com  qq:196568501
 Date: 2014.04.02  
 Description:  递归练习之换零钱方式统计(c/c++)
 *********************************************************************************/  

#include <iostream>
#include <sstream>
#include <fstream>
#include <iostream>
#include <iomanip>
#include <string>
#include <memory.h>
#include <thread> 
#include <stdlib.h>     /* labs */
#include <math.h>

using namespace std;


typedef struct
{
    int value;
    int flag;
}valut_t;

typedef struct
{
    valut_t value_50;
    valut_t value_25;
    valut_t value_10;
    valut_t value_5;
    valut_t value_1;
}all_value_t;

static int  fuction(int total_money, all_value_t value);
static int is_only_50_change(all_value_t& value);
static int is_only_25_change(all_value_t& value);
static int is_only_10_change(all_value_t& value);
static int is_only_5_change(all_value_t& value);
static int is_only_1_change(all_value_t& value);

int main()
{
    all_value_t value = http://www.mamicode.com/{{50,1},{25,1},{10,1},{5,1},{1,1}};>

递归练习之换零钱方式统计(c/c++)