| ||||||||||
| 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 | |||||||||
一个细节 if you can remove characters from t such that the concatenation of the remaining characters is
表示删除后面的一些元素后可以找到前面的字符串则还是Yes
#include<iostream>
#include<string>
#include<fstream>
using namespace std;
int main(int argc, char* argv[])
{
string a,b;
//fstream cin("aaa.txt");
while(cin>>a>>b)
{
int le=a.length();
int count=0,i=0,j=0;
if(a.length()>b.length()){printf("No\n");continue;}
for(i=0;j!=b.length()&&i<a.length();)
{
if(a[i]==b[j]){i++;j++;count++;}
else {j++;}
}
if(count==a.length())printf("Yes\n");
else printf("No\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