文件名称:Question1
介绍说明--下载内容来自于网络,使用问题请自行百度
C++源代码,递归实现。原问题描述:鼓上蚤时迁到一个山洞里去盗宝,里面有n件宝贝,价值分别是a1,a2......an,并且满足ai大于a1+a2+....+a(i-1)的和。他身上有一个背包,能装的东西最大价值是K,他只能进洞一次,请问他最多能带出多少?
要求:输入K,n,a1,a2......an
输出:他能最多带出的宝物价值
-C++ Source code Recursive achieve. The original problem descr iption: drum when flea盗宝going to move in a cave, there are n pieces of treasure, valued are a1, a2 ...... an, and to meet ai than a1+ A22B !....+ a (i-1) and. Him to have a backpack, things can hold the greatest value is K, he could only hole once, to ask him to bring out the maximum number of? Requirements: Enter K, n, a1, a2 ...... an output: he can bring out the maximum value of the treasures
要求:输入K,n,a1,a2......an
输出:他能最多带出的宝物价值
-C++ Source code Recursive achieve. The original problem descr iption: drum when flea盗宝going to move in a cave, there are n pieces of treasure, valued are a1, a2 ...... an, and to meet ai than a1+ A22B !....+ a (i-1) and. Him to have a backpack, things can hold the greatest value is K, he could only hole once, to ask him to bring out the maximum number of? Requirements: Enter K, n, a1, a2 ...... an output: he can bring out the maximum value of the treasures
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Question1.cpp
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.