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

Re:水过(附代码)(修改后)

Posted by spb3732 at 2012-12-24 20:45:35 on Problem 1936
In Reply To:水过(附代码) Posted by:spb3732 at 2012-12-24 20:35:53
#include<cstdio>
#include<cstring>
using namespace std;
const int STRLEN=100001;
char strS[STRLEN];
char strT[STRLEN];
int main()
{
	while(scanf("%s%s",strS,strT)!=EOF)
	{
		int nTIndex=0;  
		int nSIndex=0;

		while(strT[nTIndex]!='\0' && strS[nSIndex]!='\0')
		{
			if(strT[nTIndex++]==strS[nSIndex])
			{
				nSIndex++;
			}
		}
		if(strS[nSIndex]=='\0')
			printf("Yes\n");
		else
			printf("No\n");
	}
	return 0;
}

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