Advertisement
kot_mapku3

2 F

Jun 2nd, 2020
680
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <string>
  4. #include <cmath>
  5.  
  6. using namespace std;
  7.  
  8. int main() {
  9.     ios::sync_with_stdio(false);
  10.     cin.tie(nullptr);
  11.     cout.tie(nullptr);
  12.  
  13.     int y;
  14.     cin >> y >> y;
  15.     string s1, s2;
  16.     cin >> s1 >> s2;
  17.     int x = 0;
  18.  
  19.     for (int i = 0; i < s1.length(); ++i) {
  20.         if (s1.substr(i, y) == s2) x++;
  21.     }
  22.  
  23.     cout << x;
  24.  
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement