UVA - 10340 All in All :简单字符串处理

来源:互联网 发布:淘宝里实名认证在哪 编辑:程序博客网 时间:2024/06/11 04:25

这两天忙着校运会,没更新,现在补回来。

明天就去盛乐了,未来的两天,110米栏and400米栏,祝我好运。

运动会那两天,把笔记本带上,随手更新几个简单题···

202那题 不会做,有点数论的感觉,我短板···

先A了这个简单题····其实不想贴出来的···

仅仅为了更新···博文···而已···

#include <map>#include <cstdio>#include <string>#include <vector>#include <cstring>#include <fstream>#include <iostream>#include <algorithm>using namespace std;int main(){    string S1,S2;    while( cin>>S1>>S2 ){        if(S1.length()>S2.length()){            cout<<"No"<<endl;            continue;        }        int i,j;        for( i=0,j=0; i<S1.length()&&j<S2.length(); ){            if(S1[i]==S2[j]){ i++;j++; }            else{                j++;            }        }        if(i<S1.length()) cout<<"No"<<endl;        else            cout<<"Yes"<<endl;    }    return 0;}


0 0
原创粉丝点击