Advertisement
Josif_tepe

Untitled

Feb 4th, 2022
1,200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     string zbor;
  8.     cin >> zbor;
  9.     char c;
  10.     cin >> c;
  11.     int pojavuvanja = 0;
  12.     for (int i = 0; i < zbor.size(); i++)
  13.     {
  14.         if(zbor[i] == c)
  15.         {
  16.             pojavuvanja++;
  17.         }
  18.     }
  19.     cout << pojavuvanja << endl;
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement