fork(2) download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. class Napis
  6. {
  7. public:
  8. int l;
  9. };
  10. Napis a1,b1;
  11.  
  12. char *string_merge(char* a,char* b)
  13. {
  14. char* x;
  15. x=new char [2*a1.l];
  16. for(int i=0;i<2*a1.l;i+=2)
  17. {
  18. x[i]=*a;
  19. x[i+1]=*b;
  20. a++;
  21. b++;
  22. }
  23. return x;
  24. }
  25.  
  26. int main()
  27. {
  28. string a,b;
  29. int t;
  30. cin>>t;
  31. for(int i=0;i<t;i++)
  32. {
  33. cin>>a>>b;
  34. a1.l=a.length();
  35. b1.l=b.length();
  36. if(b1.l<a1.l)
  37. a1.l=b1.l;
  38. cout<<string_merge(&a[0],&b[0])<<endl;
  39. }
  40. return 0;
  41. }
  42.  
Success #stdin #stdout 0s 15240KB
stdin
4
a bb
abs sfd
ewr w
wqeqweqweq eqweqwe
stdout
ab
asbfsd
ew
weqqewqewqewqe