| ||||||||||
| 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 | |||||||||
为什么我的程序WA呀,运行了很多情况结果都满足题目呀,难道还有漏掉的?????????????#include<iostream.h>
#include<string.h>
int main(){
char s[100000],t[100000];
int l;char a;
while(cin>>s>>t){
l=strlen(s);
int l1=strlen(t);
int num=0;int i;
if(l1<l) goto No;
for( i=0;i<l1-l+1;i++){
a=t[i+l];
t[i+l]='\0';
if(s[0]!=t[i]){t[i+l]=a;continue;}
if(strcmp(s,t+i)==0){cout<<"Yes"<<endl;num=1;break;}
if(num==0)t[i+l]=a;
}
No: if(num==0) cout<<"No"<<endl;
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator