摘要: 使用标准库的栈和队列时,先包含相关的头文件 #include<stack> #include<queue> 定义栈如下: stack<int> s; 定义队列如下: queue<int> q; 阅读全文
posted @ 2017-03-22 22:36 lineaar 阅读(153) 评论(0) 推荐(0) 编辑
摘要: #include "stdafx.h" #include using namespace std; #define MAXSIZE 100 int bofei_bottom(int n) { int f[MAXSIZE]; f[0] = 0; f[1] = 1; for (int i = 2; i <= n; i++) { f[i] = f[i - 1] + f[i - 2]; ... 阅读全文
posted @ 2017-03-22 19:00 lineaar 阅读(547) 评论(0) 推荐(0) 编辑
摘要: // dongtaiguihua.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include #include #include using namespace std; int num[11]; #define c 2; int p[] = { 0,1,5,8,9,10,17,17,20,24,30 }; ////自顶向下递归实现///////... 阅读全文
posted @ 2017-03-22 11:38 lineaar 阅读(163) 评论(0) 推荐(0) 编辑