巢穴

about:blank

P1936

水题..直接帖代码

#include <iostream>
#include 
<string>
using namespace std;

string s,t;
int main()
{
    
while(cin>>s>>t)
    
{
     
int x=0;
     
bool ok=false;
     
for (int i=0;i<t.length();i++)
     
{
      
if (s[x]==t[i]) x++;
      
if (x==s.length()-1{ok=true;break;}
     }

     
if (ok) cout<<"Yes"<<endl; else cout<<"No"<<endl;
    }

    
    
return 0;
}

posted on 2009-10-19 21:28 Vincent 阅读(60) 评论(0)  编辑 收藏 引用 所属分类: 数据结构与算法


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理