您的位置:首页 > 其它

All in All UVA - 10340

2017-04-03 12:38 274 查看
问题类型:解密,字符串。

03pie’s solution for [UVA-10340]:

#include<cstdio>
#include<iostream>
#include<sstream>
#include<cstdlib>
#include<cmath>
#include<cctype>
#include<string>
#include<cstring>
#include<algorithm>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<ctime>
#include<vector>
#include<fstream>
#include<list>
using namespace std;

#define ms(s) memset(s,0,sizeof(s))typedef unsigned long long ULL;
typedef long long LL;

const double PI = 3.141592653589;
const int INF = 0x3fffffff;

#define maxn 101000
char org[maxn];
char encrp[maxn];

int main(){
//  freopen("F://inp.txt","r",stdin);
while(scanf("%s%s",org,encrp)!=EOF)
{
int orglen=strlen(org);
int encrplen=strlen(encrp);
int next=0,count=0;
for(int i=0;i<orglen;i++)
{
for(int q=next;q<encrplen;q++)
{
if(encrp[q]==org[i])
{
count++;
next=q+1;
break;
}
}
}
if(count==orglen)
{
printf("Yes\n");
}
else
{
printf("No\n");
}
}
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: