| ||||||||||
| 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>
using namespace std;
int main()
{
string str1,str2;
int len1,len2,i,j;
while(cin>>str1>>str2)
{
j=0;
len1 = str1.length();
len2 = str2.length();
for(i = 0 ; i < len2 ; i ++)
{
if( str1[j] == str2[i])
{
j++;
}
}
if(j == len1)
cout<<"Yes\n";
else
cout<<"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