码迷,mamicode.com
首页 > 其他好文 > 详细

REGEX

时间:2017-02-26 11:14:20      阅读:154      评论:0      收藏:0      [点我收藏+]

标签:time   fine   algorithm   iostream   using   stack   lis   ace   end   

#include<iostream>
#include<cmath>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<string>
#include<stack>
#include<queue>
#include<map>
#include<cstdlib>
#include<set>
#include<ctime>
#include<vector>
#include<cstdio>
#include<list>
#include<sstream>
#include<regex>
using namespace std;
typedef long long ll;
int INF=2147483647;
int inf=-2147483648;
#define mod 1000000007;
#define read(x) scanf("%d",&x);
#define fo(i,n) for(int i=0;i<(n);i++)
#define me(a) memset(a,0,sizeof(a));
#define one(x) cout<<(x)<<endl;
#define two(a,b) cout<<(a)<<" "<<(b)<<endl;
#define three(a,b,c) cout<<(a)<<" "<<(b)<<" "<<(c)<<endl;
#define four(a,b,c,d) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<endl;
//int dir[4][2]={0,1,0,-1,1,0,-1,0};
//int dir[8][2]={-1,0,1,0,0,-1,0,1,-1,-1,1,1,1,-1,-1,1};
//int dir[4][2]={-2,0,2,0,0,-2,0,2};
//int dir[6][3]={0,0,1,0,0,-1,0,1,0,0,-1,0,1,0,0,-1,0,0};
const double PI = acos(-1.0);
const double pi = 2*asin(1.0);
char s[105];
int main()
{
    ios::sync_with_stdio(false);
    int n;;
    cin>>n>>s;
    cout<<regex_replace(s,regex("ogo(go)*"),"***")<<endl;
    return 0;
}

 

REGEX

标签:time   fine   algorithm   iostream   using   stack   lis   ace   end   

原文地址:http://www.cnblogs.com/wangmenghan/p/6443698.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!