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:kainbro at 2010-01-08 22:33:41 > #include<stdio.h> > int issub(char *, char *); > main() > { > char s1[100000]; > char s2[100000]; > > while(scanf("%s %s",&s2,&s1)){ > if(issub(s1,s2)) > printf("Yes"); > else > printf("No"); > } > } > > int issub(char *s1, char *s2) > { > while(*s1 != '\0'){ > if(*s2 == *s1) > { > s1++; > s2++; > } > else > s1++; > } > if(*s2 == '\0') > return 1; > else > return 0; > } 数组开的不够大 scanf语句又写错 对你。。。。。。。。。 Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator