fork download
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <map>
  4. #include <set>
  5. #include <cmath>
  6. #include <vector>
  7. #include <climits>
  8. #include <string>
  9. #include <algorithm>
  10. #include <sstream>
  11. using namespace std;
  12.  
  13. vector<string> split(string haystack, string needle) {
  14. vector<string> result;
  15. int startPos = 0;
  16. int foundPos = haystack.find(needle, startPos);
  17. while (foundPos != string::npos) {
  18. int count = foundPos - startPos;
  19. string token = haystack.substr(startPos, count);
  20. if (!token.empty()) {
  21. result.push_back(token);
  22. }
  23. startPos = foundPos + needle.length();
  24. foundPos = haystack.find(needle, startPos);
  25. }
  26. string token = haystack.substr(startPos, haystack.length() - startPos);
  27. if (!token.empty()) {
  28. result.push_back(token);
  29. }
  30. return result;
  31. }
  32.  
  33. int main() {
  34. ios_base::sync_with_stdio(false);
  35. cin.tie(NULL);
  36. string s;getline(cin, s);
  37. string t;getline(cin, t);
  38.  
  39. if (s.find(t) != string::npos) {
  40. cout << "YES";
  41. }
  42. else {
  43. cout << "NO";
  44. }
  45. return 0;
  46. }
  47.  
Success #stdin #stdout 0s 5316KB
stdin
Standard input is empty
stdout
YES