HDU 2041 超级楼梯
2015-07-24 10:19
162 查看
题目地址:点击打开链接
思路:水题
AC代码:
#include <iostream>
using namespace std;
int main()
{
int i,n,b;
int a[41] = {0,1,1};
for(i=3; i<=40; i++)
{
a[i] = a[i-1] + a[i-2];
}
cin>>n;
while(n--)
{
cin>>b;
cout<<a[b]<<endl;
}
return 0;
}
思路:水题
AC代码:
#include <iostream>
using namespace std;
int main()
{
int i,n,b;
int a[41] = {0,1,1};
for(i=3; i<=40; i++)
{
a[i] = a[i-1] + a[i-2];
}
cin>>n;
while(n--)
{
cin>>b;
cout<<a[b]<<endl;
}
return 0;
}
相关文章推荐
- java并发编程实战第五章(3)异步运行任务
- linux把光盘复制成ISO文件方法
- PigSPS: a database for pig SNPs and signatures of positive selection
- jQuery插件开发方式
- maven入门
- note
- MACOS无限试用Cornerstone的方法
- Search for a Range
- sql 分页存储过程
- dialog弹出,点击back按键无法返回问题解决
- HDU 5308 I Wanna Become A 24-Point Master(2015多校第二场)
- 五种基于RGB色彩空间统计的皮肤检测算法
- 五种基于RGB色彩空间统计的皮肤检测算法
- 实习16天
- 五种基于RGB色彩空间统计的皮肤检测算法
- HDU 1710 二叉树遍历
- Spring+iBatis+Atomikos实现JTA事务
- iOS appdelegate 中将自定义的视图作为启动视图
- 五种基于RGB色彩空间统计的皮肤检测算法 分类: 视频图像处理 2015-07-24 10:18 48人阅读 评论(0) 收藏
- java中全排列的生成算法汇总