PREV_IN_POST
来源:互联网 发布:情侣 第一次旅游 知乎 编辑:程序博客网 时间:2024/05/16 05:23
#include<stdio.h>
#include<stdio.h>
#include<string.h>
char a[28];
char b[28];
int count;
int all;
int step;
void search(int m, int n){
int i;
if(count == all){
return ;
}
for(i = m; i < n; i++){
if(b[i] == a[step]){
count++;
step++;
break;
}
}
if(i == n){
return ;
}
search(m, i); //左子树
search(i + 1, n); //右子树
printf("%c", b[i]);
}
int main()
{
int j;
memset(a, 0, sizeof(a));
memset(b, 0, sizeof(b));
while(scanf("%s %s", a, b) != EOF){
getchar();
step = 0;
count = 0;
j = strlen(a);
all = j;
search(0, all);
printf("\n");
memset(a, 0, sizeof(a));
memset(b, 0, sizeof(b));
}
return 0;
}
#include<stdio.h>
#include<string.h>
char a[28];
char b[28];
int count;
int all;
int step;
void search(int m, int n){
int i;
if(count == all){
return ;
}
for(i = m; i < n; i++){
if(b[i] == a[step]){
count++;
step++;
break;
}
}
if(i == n){
return ;
}
search(m, i); //左子树
search(i + 1, n); //右子树
printf("%c", b[i]);
}
int main()
{
int j;
memset(a, 0, sizeof(a));
memset(b, 0, sizeof(b));
while(scanf("%s %s", a, b) != EOF){
getchar();
step = 0;
count = 0;
j = strlen(a);
all = j;
search(0, all);
printf("\n");
memset(a, 0, sizeof(a));
memset(b, 0, sizeof(b));
}
return 0;
}
0 0
- PREV_IN_POST
- Struts2看书笔记
- junit4 与 javaee 5.0 jpa包冲突
- SetThreadAffinityMask设置使用多核CPU的哪个核心
- 单片机串口接收——WIN32多线程基础
- POST_IN_PREV
- PREV_IN_POST
- Android Studio中java.lang.AssertionError异常解决方案
- SetThreadAffinityMask用途
- poj 2965 dfs+保存路径
- Oracle面向对象编程OOP
- Android系统启动过程剖析
- 黑马程序员_Eclipse使用及其常用快捷键
- java迭代器
- mysql存储过程 在动态SQL内获取返回值