Created
August 30, 2016 10:02
-
-
Save anonymous/4452a59069b6092ae3d164c677573b61 to your computer and use it in GitHub Desktop.
Problem with connection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
string marge(string a, string b) | |
{ | |
string c; | |
if(a.length() <= b.length()) | |
{ | |
for(int i = 0, j = 0; i < a.length(); i++, j++) | |
{ | |
c += a[i]; | |
c += b[i]; | |
} | |
} | |
else | |
{ | |
for(int i = 0, j = 0; i < b.length(); i++, j++) | |
{ | |
c += a[i]; | |
c += b[i]; | |
} | |
} | |
return c; | |
} | |
int main() | |
{ | |
int n; | |
string a, b; | |
cin>>n; | |
while(n--) | |
{ | |
cin>>a>>b; | |
cout<<marge(a,b)<<endl; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment