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> using namespace std; #include <string.h> #include <stdio.h> int main() { char s[100001],t[100001]; int i,j,k; char c; k=0; c=getchar(); while(c!=' ') { t[k++]=c; c=getchar(); } while(1) { i=0; j=0; s[j]=getchar(); while(s[j]!='\n') { if(t[i]==s[j]) { i++; if(i==k) { cout<<"Yes"<<endl; break; } } j++; s[j]=getchar(); } if(i!=k) cout<<"No"<<endl; k=0; flushall(); c=getchar(); if(c==EOF) break; while(c!=' ') { t[k]=c; k++; c=getchar(); } } return 1; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator