Guest User

Untitled

a guest
Feb 22nd, 2015
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include <string>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.    
  10.  
  11. string wyraz = "Ala ma kota duzego i zwie";
  12. string szukaj = " ";
  13. int z = 0, il=0;
  14. while(z<3)
  15. {
  16.  
  17. size_t pozycja = wyraz.find(szukaj);
  18. wyraz.erase(pozycja,1);
  19.  
  20. il++;
  21. if(pozycja == string::npos)
  22. {
  23.  
  24. z=z+10;
  25.  
  26.  
  27. }
  28. }
  29. cout<<endl;
  30. cout<<il;
  31.  
  32.  
  33.    
  34.  
  35.     return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment