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 |
请高手指点,为什么挂呢?#include<stdio.h> #include<string.h> void main() { long i,len; char s[50000]; long a[50009]; while(scanf("%s",s),strcmp(s,"0")) { len=strlen(s); for(i=1;i<len;i++) { a[0]=1; a[1]=1; int temp; temp=(s[i-1]-'0')*10+s[i]-'0'; if(s[i]=='0') a[i+1]=a[i]; else if(temp>26) a[i+1]=a[i]; else if(temp<10) a[i+1]=a[i-1]; else a[i+1]=a[i]+a[i-1]; } printf("%ld\n",a[i]); } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator