Advertisement
rootuss

szukaj

Feb 27th, 2017
438
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     string napis="Ala ma kota";
  8.  
  9.     string szukaj="kot";
  10.  
  11.     size_t pozycja=napis.find(szukaj);
  12.  
  13.     cout<<pozycja;]
  14.  
  15.  
  16.     if(pozycja!=string::npos)
  17.     {
  18.         cout<<"Znaleziono na pozycji "<< pozycja<<endl;
  19.     }
  20.     else cout<<"Nie znaleziono"<<endl;
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement