其他分享
首页 > 其他分享> > HDU 2046 骨牌铺方格

HDU 2046 骨牌铺方格

作者:互联网

链接

骨牌铺方格 - http://acm.hdu.edu.cn/showproblem.php?pid=2046

分析

在这里插入图片描述

1 1 1 1 1 1 0 1 2 3 4 5 6

超级楼梯 - https://blog.csdn.net/jpphy0/article/details/116832315?spm=1001.2014.3001.5502

代码

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll ans[55];
int t; 
int main(){
	ans[1]=1;ans[2]=2;
	for(int i=3;i<=51;i++){
		ans[i]=ans[i-1]+ans[i-2];
	 } 
	int a;
	while(scanf("%d",&a)!=EOF){
		printf("%lld\n",ans[a]);
	}
	return 0;
 } 

标签:2046,HDU,int,ll,long,骨牌,ans
来源: https://blog.csdn.net/jpphy0/article/details/116835422