Created
June 4, 2017 14:32
-
-
Save emlai/b93bfec90299397fbfd44abbae790a86 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 <string> | |
#include <iostream> | |
using namespace std; | |
int main() { | |
string s = "lollero"; | |
string t = "lerolo"; | |
auto si = s.begin() + 3; | |
auto ti = t.begin(); | |
while (true) { | |
if (si == s.end()) { | |
si = s.begin(); | |
} | |
if (ti == t.end()) { | |
cout << "match"; | |
break; | |
} | |
if (*si != *ti) { | |
cout << "mismatch"; | |
break; | |
} | |
si++; | |
ti++; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment