摘要: 递归算法://背包问题-递归.cpp:定义控制台应用程序的入口点。//#include"stdafx.h"intw[5]={1,4,4,5,7};intknap(ints,intn){if(s==0){return(1);}else{if(s<0||(s>0&&n<1)){return(0);}elseif(knap(s-w[n-1],n-1)==1){print... 阅读全文
posted @ 2009-11-08 21:52 成长の足迹 阅读(488) 评论(0) 推荐(0) 编辑