Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define ll long long
- #define _test int _TEST; cin>>_TEST; while(_TEST--)
- #define pb push_back
- int main()
- {
- _test
- {
- string x, y;
- cin>>x>>y;
- string a, b;
- int d = -1;
- do{
- d++;
- a.pb(max(x[d], y[d]));
- b.pb(min(x[d], y[d]));
- }while(d+1<x.size() && x[d]==y[d]);
- for(int i=d+1; i<x.size(); i++)
- {
- a.pb(min(x[i], y[i]));
- b.pb(max(x[i], y[i]));
- }
- cout<<a<<"\n"<<b<<"\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement