hiho Week 10 register

Ended

Participants:639

Verdict:Accepted
Score:100 / 100
Submitted:2014-09-07 10:11:19

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <iostream>
#include <string>
using namespace std;
void post(string pre,string mid){
    if(pre.length() <= 1){
        cout << pre;return;
    }
    size_t loc =  mid.find(pre[0]);
    post(pre.substr(1,loc),mid.substr(0,loc));
    post(pre.substr(loc+1),mid.substr(loc+1));
    cout << pre[0];
}
int main(){
    string pre,mid;
    cin >> pre >> mid;
    post(pre,mid);
    return 0;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX