fork download
  1. #include <iostream>
  2. #include <cstring>
  3.  
  4. using namespace std;
  5.  
  6. #define T_SIZE 1001
  7.  
  8. char* string_merge(char* m, char* n)
  9. {
  10. int dlugosc=strlen(m);
  11. int dlugosc2=strlen(n);
  12. int y;
  13.  
  14. if(dlugosc<=dlugosc2)y=dlugosc-1;
  15. if(dlugosc2<=dlugosc)y=dlugosc2-1;
  16.  
  17. for(int i=0; i<=y; i++)
  18. {
  19. cout<<m[i];
  20. cout<<n[i];
  21. }
  22. cout<<endl;
  23. return m;
  24. }
  25.  
  26. int main()
  27. {
  28. int t;
  29.  
  30. char S1[T_SIZE], S2[T_SIZE], *S;
  31. cin>>t;
  32. cin.getline(S1, T_SIZE);
  33.  
  34.  
  35.  
  36. while(t)
  37. {
  38. cin.getline(S1, T_SIZE,' ');
  39. cin.getline(S2, T_SIZE);
  40. S=string_merge(S1,S2);
  41. t--;
  42. }
  43.  
  44. return 0;
  45. }
  46.  
Success #stdin #stdout 0s 4388KB
stdin
Standard input is empty
stdout