Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:超时了,请你们帮帮忙啊,不知道哪里超时?In Reply To:超时了,请你们帮帮忙啊,不知道哪里超时? Posted by:dordy at 2008-11-09 11:47:34 > #include<stdio.h> > int i,k; > int a[46]; > long b[46]; > int bit(int i) > { > > if(i==1) return 2; > else if(i==2) return 3; > else if(i>2) return b[i]=bit(i-1)+bit(i-2); > else return 0; > } > > int main() > { > scanf("%d",&k); > while(k>45) > { > printf("k值不要大于45,请重新输入:"); > scanf("%d",&k); > } > for(i=0;i<k;i++) > { > scanf("%d",&a[i]); > printf("Scenario #%d:\n%d\n",i+1,bit(a[i])); > } > printf("\n"); > return 0; > } 里面的中文等等输入就不要要了 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator