## 百练 1936: 全在其中 之 C 解答 原

圣洁之子

http://bailian.openjudge.cn/practice/1936/

```sequence subsequence
person compression
VERDI vivaVittorioEmanueleReDiItalia
caseDoesMatter CaseDoesMatter```

```Yes
No
Yes
No```

Ulm Local 2002

``````#include<stdio.h>
#include<string.h>
#define M 100000
int main()
{
char ch1[M+1],ch2[M+1];
while(scanf("%s %s",ch1,ch2) == 2)
{
int len1,len2,i,j,k;
len1=strlen(ch1);
len2=strlen(ch2);
k=j=0;
for(i=0;i<len1;++i)
{
if(j==len2)
break;
for(;j<len2;j++) //j一直加，从而使顺序不变
{
if(ch1[i]==ch2[j])
{
k++;
j++;
break;
}
}
}
if(k==len1)
printf("Yes\n");
else
printf("No\n");
}
return 0;
}``````

``````import java.util.Scanner;

public class OpenJudge1936 {

public static void main(String[] args) {
Scanner cin = new Scanner(System.in);
String line = "";
while (!(line = cin.nextLine()).equals("")) {
String plain = line.split(" ")[0];
String cipher = line.split(" ")[1];
boolean contained = true;
int j = 0;
for (int i = 0; i < plain.length(); i++) {
boolean found = false;
// Note that only start from 0 for the first character in plain
for (; j < cipher.length(); j++) {
if (plain.charAt(i) == cipher.charAt(j)) {
found = true;
j++;
break;
}
}
if (!found) {
contained = false;
break;
}
}
if (contained) {
System.out.println("Yes");
} else {
System.out.println("No");
}
}
cin.close();
}

}
``````

### 圣洁之子

InfoQ上很不错的技术分享（待续）

2015/09/20
0
0

2016/07/20
17
1
Java篇-利用反射构建动态代理

*注 : 有疑问,需要解答请留言,我每个留言都会认真分析解答. 一 : 静态代理 2018世界杯到了,足球巨星表现很抢眼,我很喜欢他,他一直是我的偶像,他的球技很高超,力量很惊人.但是精通于踢球参加日...

TianTianBaby223
2018/07/08
0
0
java cas求解惑

wtintslt
2017/10/09
163
6

cdjiehua
2018/03/28
0
0

rabbitmq

24分钟前
0
0

-九天-
51分钟前
1
0

hblt-j
52分钟前
4
0
Java在什么时候会出现内存泄漏

56分钟前
2
0
android 打开摄像头

private SurfaceHolder mHolder; private SurfaceView mSurfaceView; private Camera mCamera; mSurfaceView = (SurfaceView) this.findViewById(R.id.camsurfaceView1); mHolder = mSurface......

jingshishengxu

2
0