Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

此题实际上是fibonacci数列的变形

Posted by lzxzy at 2018-08-24 11:32:30 on Problem 1953 and last updated at 2018-08-24 11:33:04
/*附代码 0ms*/

#include <cstdio>
using namespace std;
int n,k,t;
int f[105];

int main()
{
	f[0]=1;f[1]=2;
	for(int i=2;i<=45;i++)f[i]=f[i-1]+f[i-2];
	scanf("%d",&n);t=0;
	while(n--)
	{
		t++;
		scanf("%d",&k);
		printf("Scenario #%d:\n%d\n\n",t,f[k]);
	}
	return 0;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator