fork download
  1. //Bai12
  2.  
  3. #include<bits/stdc++.h>
  4. using namespace std;
  5. #define el "\n"
  6. #define ll long long
  7. #define ull unsigned long long
  8. #define se second
  9. #define fi first
  10. #define be begin()
  11. #define en end()
  12. #define Faster cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
  13. string s;
  14. void Run()
  15. {
  16. cin >> s;
  17. s = " " + s;
  18. vector<string> vt;
  19. int mid = s.size() / 2;
  20. for(int i = 1; i <= mid; i++)
  21. {
  22. string tmp = "";
  23. for(int j = mid - i + 1; j <= mid + i - 1; j++) tmp += s[j];
  24. vt.push_back(tmp);
  25. }
  26. for(int i = 0; i < mid; i++) cout << vt[i] << el;
  27. for(int i = mid - 2; i >= 0; i--) cout << vt[i] << el;
  28.  
  29. }
  30. int main()
  31. {
  32. Faster;
  33. Run();
  34. return 0;
  35. }
  36.  
  37.  
Success #stdin #stdout 0.01s 5280KB
stdin
Standard input is empty
stdout
Standard output is empty