fork(7) download
  1. #include <iostream>
  2. #include <cstring>
  3. #include <algorithm>
  4. using namespace std;
  5.  
  6. string polacz (string a, string b);
  7.  
  8.  
  9. int main()
  10. {
  11. int t;
  12. string a,b;
  13.  
  14. cin>>t;
  15. for (int i=0; i<t; ++i)
  16. {
  17. cin>>a>>b;
  18. }
  19. cout<<(polacz)<<endl;
  20. return 0;
  21. }
  22.  
  23. string polacz (string a, string b)
  24. {
  25. int dlugosc;
  26. {
  27. if (a.length()<b.length())
  28. return a;
  29. else
  30. return b;
  31. }
  32. string nowy= " ";
  33. for (int i=0; i<dlugosc; ++i)
  34. {
  35. nowy+=a[i];
  36. nowy+=b[i];
  37.  
  38. }
  39. return nowy;
  40.  
  41. }
  42.  
  43.  
Success #stdin #stdout 0s 5664KB
stdin
Standard input is empty
stdout
1