正则表达式 HihoCoder - 1082 字符串替换

题目链接

题意:字符串替换

正则表达式 还是厉害

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

int main(){
    string s;
    regex r("[mM][aA][Rr][Ss][Hh][Tt][Oo][Mm][Pp]");
    while(getline(cin,s))
        cout<<regex_replace(s,r,"fjxmlhx")<<endl;
	return 0;
}

猜你喜欢

转载自blog.csdn.net/weixin_42754600/article/details/88371769