超级楼梯
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
const int maxn = 1000 + 10;
int t;
int n;
LL a[maxn];
void solve()
{
scanf("%d",&t);
a[0] = 1;
a[1] = 1;
a[2] = 2;
a[3] = 3;
for(int i = 2;i<=51;i++)
{
a[i] = a[i-2] + a[i-1];
}
while(t--)
{
int c;
scanf("%d",&c);
printf("%lld\n",a[c]);
}
}
int main()
{
solve();
return 0;
}
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.util.concurrent.LinkedBlockingDeque;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;
import java.util.Stack;
import java.lang.Math;
public class Main
{
Scanner cin = new Scanner(new BufferedInputStream(System.in));
int t;
int a,b;
long[] f = new long[100 + 10];
void solve()
{
t = cin.nextInt();
f[0] = 1;
f[1] = 1;
f[2] = 2;
f[3] = 3;
for(int i = 2;i<=56;i++)
{
f[i] = f[i-1] + f[i-2];
}
while(t!=0)
{
t--;
a = cin.nextInt();
System.out.println(f[a-1]);
}
}
public static void main(String[] args)
{
new Main().solve();
}
}