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;
}
 

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 學習程式 的頭像
    學習程式

    程式學習日記,如果我幫助了你請讓我知道

    學習程式 發表在 痞客邦 留言(0) 人氣()