Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <string>
- using namespace std;
- int main()
- {
- string wyraz = "Ala ma kota duzego i zwie";
- string szukaj = " ";
- int z = 0, il=0;
- while(z<3)
- {
- size_t pozycja = wyraz.find(szukaj);
- wyraz.erase(pozycja,1);
- il++;
- if(pozycja == string::npos)
- {
- z=z+10;
- }
- }
- cout<<endl;
- cout<<il;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment