fork download
  1.  
  2. #include <iostream>
  3. #include <string>
  4. using namespace std;
  5.  
  6. int main ()
  7. {
  8. int t;
  9. cin>>t;
  10. while(t--)
  11. {
  12. string str;
  13. string str2;
  14. cin>>str>>str2;
  15. size_t found = str.find(str2);
  16. if (found!=std::string::npos)
  17. cout<<"YES"<<endl;
  18. else
  19. cout<<"NO"<<endl;
  20. }
  21.  
  22. return 0;
  23. }
Success #stdin #stdout 0s 3432KB
stdin
2
pineapple
app
hackerearth
hck
stdout
YES
NO