File tree Expand file tree Collapse file tree 1 file changed +52
-0
lines changed Expand file tree Collapse file tree 1 file changed +52
-0
lines changed Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments