fork download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. int main()
  5. {
  6. std::string terminate = "gotowe";
  7. std::string temp = "";
  8. int counter = 0;
  9.  
  10.  
  11. while(true) {
  12. std::cin >> temp;
  13. if(temp == terminate)
  14. break;
  15.  
  16. counter++;
  17. }
  18.  
  19. std::cout << "ostatnie slowo: " << temp << ", liczba slow: " << counter;
  20.  
  21. return 0;
  22. }
  23.  
Success #stdin #stdout 0s 3432KB
stdin
dla
wszystkich
placzkow
z
4programmers
wyluzujcie
troche
bo
sie
gotowe
wrzodow
nabawicie
stdout
ostatnie slowo: gotowe, liczba slow: 9