MohamedAbdel3al

I Love strings

Aug 6th, 2021
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #include <iostream>
  2. #include <bits/stdc++.h>
  3. using namespace std ;
  4. typedef long long ll ;
  5.  
  6. int main() {
  7. ios_base::sync_with_stdio(false) , cin.tie(nullptr) , cout.tie(nullptr) ;
  8. int n ;
  9. cin >> n ;
  10. string s , t ;
  11. while (n--) {
  12. cin >> s >> t ;
  13. for (int i = 0; i < max(s.size() , t.size()); i++) {
  14. if (s[i] == '\0') cout << t[i] ;
  15. else if (t[i] == '\0') cout << s[i] ;
  16. else cout << s[i] << t[i] ;
  17. }
  18. cout << "\n" ;
  19. }
  20.  
  21. return 0 ;
  22. }
  23.  
  24.  
Advertisement
Add Comment
Please, Sign In to add comment