Skip to content

Commit eebbe4e

Browse files
authored
Create K. I Love strings.cpp
1 parent 2f16c12 commit eebbe4e

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

K. I Love strings.cpp

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
//K. I Love strings
2+
#include <bits/stdc++.h>
3+
using namespace std;
4+
5+
int main ()
6+
{
7+
int t;
8+
cin >> t;
9+
10+
while (t--)
11+
{
12+
string s,t;
13+
cin >> s >> t;
14+
15+
if ( s.length() == t.length() )
16+
{
17+
for (int i = 0; i < t.length() ; i++)
18+
{
19+
cout << s[i] << t[i];
20+
}
21+
cout << "\n";
22+
}
23+
else if (s.length() > t.length())
24+
{
25+
for (int i = 0; i < t.length() ; i++)
26+
{
27+
cout << s[i] << t[i];
28+
}
29+
for (int j = t.length(); j < s.length();j++)
30+
{
31+
cout << s[j];
32+
}
33+
cout << "\n";
34+
}
35+
else if (t.length() > s.length())
36+
{
37+
for (int i = 0; i < s.length() ; i++)
38+
{
39+
cout << s[i] << t[i];
40+
}
41+
for (int j = s.length(); j < t.length();j++)
42+
{
43+
cout << t[j];
44+
}
45+
cout << "\n";
46+
}
47+
48+
49+
}
50+
51+
return 0;
52+
}

0 commit comments

Comments
 (0)