fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.  
  6. unsigned int rozmiar = 1000;
  7. unsigned short n, k = 0;
  8. char tekst[rozmiar];
  9. cin.clear();
  10.  
  11. cin >> n;
  12. n=n+1;
  13. while(n--)
  14. {
  15. cin.getline(tekst, rozmiar);
  16.  
  17. for(int i=0; tekst[i] != (char)0; i++)
  18. {
  19. k++;
  20. }
  21. for(int i=0; i<k/2; i++)
  22. {
  23. cout << tekst[i];
  24. }
  25. k = 0;
  26. cout << endl;
  27. }
  28. return 0;
  29. }
Success #stdin #stdout 0s 3472KB
stdin
3
pierwszy
lubiec
ktotozrobi
stdout
pier
lub
ktoto