poj 2255
来源:互联网 发布:河北工业大学知乎 编辑:程序博客网 时间:2024/05/28 18:45
#include<stdio.h>
#include<string.h>
void build(int n,char *s1,char *s2,char *s)
{
if(n<=0)
return;
int p=strchr(s2,s1[0])-s2;
build(p,s1+1,s2,s);
build(n-p-1,s1+p+1,s2+p+1,s+p);
s[n-1]=s1[0];
}
int main()
{
int n;
char s1[100],s2[100],s[100];
while(scanf("%s%s",s1,s2)!=EOF)
{
n=strlen(s1);
build(n,s1,s2,s);
s[n]=0;
printf("%s\n",s);
}
return 0;
}
#include<string.h>
void build(int n,char *s1,char *s2,char *s)
{
if(n<=0)
return;
int p=strchr(s2,s1[0])-s2;
build(p,s1+1,s2,s);
build(n-p-1,s1+p+1,s2+p+1,s+p);
s[n-1]=s1[0];
}
int main()
{
int n;
char s1[100],s2[100],s[100];
while(scanf("%s%s",s1,s2)!=EOF)
{
n=strlen(s1);
build(n,s1,s2,s);
s[n]=0;
printf("%s\n",s);
}
return 0;
}
0 0
- POJ 2255
- POJ 2255
- POJ 2255
- POJ-2255
- poj 2255
- poj 2255
- POJ 2255
- poj 2255
- poj 2255
- poj 2255
- POJ-2255
- poj 2255
- poj 2255 Tree Recovery
- Tree Recovery---POJ--2255
- POJ 2255 Tree Recovery
- POJ 2255 Tree Recovery
- poj 2255 Tree Recovery
- POJ 2255: Tree Recovery
- 设置 Unity,为 Blackberry10 设备构建应用程序
- Farey Sequence - POJ 2478 欧拉公式
- MFC写壳
- Java AWT学习
- iOS 蓝牙开发那些事
- poj 2255
- 类似微信陌陌app百万级并发系统源码转让
- 电机上下限位换向电路设计
- Ubuntu下OpenGL开发环境的搭建(转载)
- 14.3.2 提取数据字典
- 2014.04.04 因思考而失眠
- 【LeetCode】 Determine whether an integer is a palindrome. Do this without extra space
- openfire安装及配置
- ubuntu创建、删除文件及文件夹,强制清空回收站方法