fork download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. string skroc (string wyraz)
  7. {
  8. string polowa;
  9.  
  10. polowa=wyraz.erase((wyraz.length()/2),(wyraz.length()/2));
  11.  
  12. return polowa;
  13. }
  14.  
  15. int main()
  16. {
  17. string napis; int t;
  18.  
  19. cin>> t;
  20. for (int i=1; i<=t; i++)
  21. {
  22. cin>> napis;
  23.  
  24. cout << skroc(napis);
  25. }
  26. cout<<endl;
  27. return 0;
  28. }
Success #stdin #stdout 0s 4472KB
stdin
3
pierwszy
lubiec
ktotozrobi
stdout
pierlubktoto