题解 | #A-布置会场(I)#

A-布置会场(I)

https://ac.nowcoder.com/acm/problem/14541

#include<iostream>
using namespace std;

int dp[110];

void sc()
{
    int n;
    scanf("%d",&n);
    dp[1]=1;
    dp[2]=2;
    
    for(int i=3;i<=n;i++)
    {
        
       dp[i]=dp[i-1]+dp[i-2];
    }
    cout<<dp[n]<<endl;
}

int main()
{
    int t;
    scanf("%d",&t);
    while(t--) sc();
}
全部评论

相关推荐

星辰再现:裁员给校招生腾地方
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务