uva10701
来源:互联网 发布:慈溪行知职校电话 编辑:程序博客网 时间:2024/06/11 14:54
#include <iostream>#include <string>#include <string.h>using namespace std;void slove(char*,char*,int);int main(){char pr[60], in[60];int T, n;string str;cin >> T;while (T--){cin >> n;cin >> str;strcpy(pr,str.c_str());cin >> str;strcpy(in, str.c_str());slove(pr,in,n);cout << endl;}}void slove(char *pr, char *in, int length){if (length == 0)return;char a = *pr;int rootIndex = 0;for (; rootIndex < length; rootIndex++){if (in[rootIndex] == *pr)break;}slove(pr + 1, in, rootIndex);slove(pr + rootIndex + 1, in + rootIndex + 1, length - rootIndex - 1);cout <<a;}
0 0
- uva10701
- UVa10701 - Pre, in and post
- 分数的累加
- Linux内核中的IPSEC实现(4)
- OpenCV中的assert函数
- 2014/10/26 win7 x64位系统下在VS2010下配置MPICH2
- TextView 使用自定义字体并高亮显示
- uva10701
- BEGINNING SHAREPOINT® 2013 DEVELOPMENT 第15章节--开发SP2013工作流应用程序 工作流和Visual Studio
- 数据库重复记录删除
- Ajax技术(1)--技术初探
- cookie 和session 的区别详解
- LeetCode 85 Plus One
- android学习一(了解android)
- hdu1272
- IO - 同步,异步,阻塞,非阻塞 (亡羊补牢篇)