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

Re:very easy

Posted by abc235153452 at 2010-01-02 10:32:26 on Problem 2000
In Reply To:Re:靠!我这么完美的程序居然不过! Posted by:maxflying at 2005-12-21 15:29:27
#include<stdio.h>
int a[100001];
void abc(int n)
{int i;
a[1]=2;
a[2]=3;
for(i=3;i<=n;i++)
a[i]=a[i-1]+a[i-2];
}
int main()
{int n,m,i;
scanf("%d",&n);
for(i=1;i<=n;i++)
{scanf("%d",&m);
printf("Scenario #%d:\n",i);
abc(100000);
printf("%d\n",a[m]);
if(i!=n)printf("\n");
}
}

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