close
#include <iostream>
#include <string>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char** argv) {
string s2("hijson");
string s3("on");
for (int i=0;i<s2.length();i++){
bool match=true;
if(i+s3.length()>s2.length()) break;
for(int j=0;j<s3.length();j++) {
if(s2[i+j]!=s3[j]){
match=false;
break;
}else{
}
}
if(match==true){
cout<<"true";
}
}
return 0;
}
全站熱搜