-
Notifications
You must be signed in to change notification settings - Fork 0
/
K. I Love strings.cpp
52 lines (46 loc) · 1.01 KB
/
K. I Love strings.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//K. I Love strings
#include <bits/stdc++.h>
using namespace std;
int main ()
{
int t;
cin >> t;
while (t--)
{
string s,t;
cin >> s >> t;
if ( s.length() == t.length() )
{
for (int i = 0; i < t.length() ; i++)
{
cout << s[i] << t[i];
}
cout << "\n";
}
else if (s.length() > t.length())
{
for (int i = 0; i < t.length() ; i++)
{
cout << s[i] << t[i];
}
for (int j = t.length(); j < s.length();j++)
{
cout << s[j];
}
cout << "\n";
}
else if (t.length() > s.length())
{
for (int i = 0; i < s.length() ; i++)
{
cout << s[i] << t[i];
}
for (int j = s.length(); j < t.length();j++)
{
cout << t[j];
}
cout << "\n";
}
}
return 0;
}