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

模拟

Posted by zhouzp15 at 2017-01-18 22:18:48 on Problem 1936
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;

const int N = 100000 + 5;
char T[N], P[N];

int main()
{
	while (scanf("%s %s", P, T) == 2)
	{
		int lenP = strlen(P), lenT = strlen(T);
		int i = 0, j = 0;
		while (i < lenT && j < lenP)
			if (T[i] == P[j]) i++, j++;
			else i++;
		if (j < lenP) printf("No\n");
		else printf("Yes\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