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 |
模拟#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator