标签:int names str tput else 爬楼梯 turn ios main
#include "stdafx.h"
#include "iostream"
using namespace std;
int fibonacci(int n)
{
if (n > 2)
return fibonacci(n - 1) + fibonacci(n - 2);
else
return 1;
}
int main()
{
int data[20];
int t;
int i;
cin>>"Please input T and the nums: \n";
cin>>"%d",&t;
for (i = 0; i<t; i++)
{
cin>>"%d", &data[i];
}
cout<<"The output: \n";
for (i = 0; i<t; i++)
{
cout<<"%d\n", fibonacci(data[i] + 1);
}
return 0;
}
标签:int names str tput else 爬楼梯 turn ios main
原文地址:http://www.cnblogs.com/lvzhanying/p/6518421.html