uva536
来源:互联网 发布:慈溪行知职校电话 编辑:程序博客网 时间:2024/06/11 13:29
#include <iostream>#include <string>#include <string.h>using namespace std;void slove(char*,char*,int);int main(){char pr[60], in[60];string str1, str2;while (cin >> str1 >> str2){strcpy(pr,str1.c_str());strcpy(in, str2.c_str());slove(pr,in,str1.length());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
- uva536
- uva536
- 树的重建uva536
- uva536 Tree Recovery
- 【二叉树】UVA536
- uva536 Tree Recovery
- UVA536 - Tree Recovery
- UVa536 Tree Recovery
- uva536 Tree Recovery
- UVA536 Tree Recovery
- uva536 -- Tree Recovery
- Tree Recovery UVA536
- UVA536 - Tree Recovery(递归)
- Uva536——Tree Recovery
- 习题6-3 二叉树重建 UVa536
- 二叉树重建(Tree Recovery ,UVa536)
- uva536-Tree Recovery-二叉树遍历
- uva536(先序 + 中序输出后序)
- SOCK_RAW Demystified
- twisted、protobuf、zmq的结合使用
- Linux内核中的IPSEC实现(3)
- 动态规划---插花/花店橱窗设计
- BEGINNING SHAREPOINT® 2013 DEVELOPMENT 第15章节--开发SP2013工作流应用程序 Visio Pro/SPD和工作流
- uva536
- 分数的累加
- Linux内核中的IPSEC实现(4)
- OpenCV中的assert函数
- 2014/10/26 win7 x64位系统下在VS2010下配置MPICH2
- TextView 使用自定义字体并高亮显示
- uva10701
- BEGINNING SHAREPOINT® 2013 DEVELOPMENT 第15章节--开发SP2013工作流应用程序 工作流和Visual Studio
- 数据库重复记录删除