Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

哪位大虾给看一下哪的错误!一直是WA!

Posted by 194 at 2006-08-16 10:10:50 on Problem 1936
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator