2020年1月17日
摘要: 问题:一老师爬楼梯,楼梯有n阶,一次只能走1阶或2阶,请问有几种走法? #include <iostream> using namespace std; int fun(int a) { static int i = 0; if(a==0||a==1) return 1; return fun(a- 阅读全文
posted @ 2020-01-17 23:27 缘随风烬 阅读(1810) 评论(0) 推荐(0) 编辑
摘要: priority_queue<int> q;//默认优先级队列的定义。 在默认的优先队列中,优先级高的先出队。在默认的int型中先出队的为较大的数。 #include <iostream> #include <vector> #include <queue> using namespace std; 阅读全文
posted @ 2020-01-17 22:27 缘随风烬 阅读(810) 评论(0) 推荐(0) 编辑