摘要: The Triangle 时间限制:1000 ms | 内存限制:65535 KB 难度:4 7 3 8 8 1 0 2 7 4 4 4 5 2 6 5 (Figure 1) Figure 1 shows a number triangle. Write a program that calcula 阅读全文
posted @ 2016-05-21 17:58 Lawliet__zmz 阅读(128) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std;int main(){ cout inline const _Ty& (max)(const _Ty& _Left, const _Ty& _Right) { // return larger of _Left and _... 阅读全文
posted @ 2016-05-21 17:57 Lawliet__zmz 阅读(305) 评论(0) 推荐(0) 编辑
摘要: 超级台阶时间限制:1000 ms | 内存限制:65535 KB难度:3描述 有一楼梯共m级,刚开始时你在第一级,若每次只能跨上一级或二级,要走上第m级,共有多少走法?注:规定从一级到一级有0种走法。输入输入数据首先包含一个整数n(1using namespace std;const int N... 阅读全文
posted @ 2016-05-21 16:22 Lawliet__zmz 阅读(156) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std;const int N = 25;int F[25] = {1,1};int Fib(int n){ if(F[n]) return F[n]; return F[n]=Fib(n-1)+Fib(n-2); }int main()... 阅读全文
posted @ 2016-05-21 15:21 Lawliet__zmz 阅读(95) 评论(0) 推荐(0) 编辑