repeat_string一部の文字を削除します

文字列は文字を検索し、_temp_two_meansを削除します

// 
#include<bits/stdc++.h>
using namespace std;

int main()
{
    string s,s1;
    int pos;

    while( getline( cin,s ) )
    {
        getline( cin,s1 );
        pos=s.find( s1 );
        if( pos!=-1 ) s.erase( pos,s1.size() );
        cout<<s<<endl;
    }
    return 0;
}

おすすめ

転載: blog.csdn.net/qq_63173957/article/details/124350300