Created
October 20, 2016 18:07
-
-
Save own2pwn/12bc7cfcc831155219a63dda53035fa0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
using namespace std; | |
int main() { | |
string s1,s2; | |
cin >> s1 >> s2; | |
int count = 0; | |
auto currPos = s2.find(s1, 0); | |
while(currPos != string::npos) | |
{ | |
count++; | |
currPos = s2.find(s1, currPos + 1); | |
} | |
cout << count; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment