• codeforces 363B


    #include<stdio.h>
    #include<string.h>
    #define N 200100
    char s[N];
    int main() {
    int i;
    while(scanf("%s",s)!=EOF) {
            if(strlen(s)<3) {
    printf("%s ",s);
    continue;
    }
    printf("%c%c",s[0],s[1]);
    for(i=2;s[i];i++) {
    if(s[i-1]==s[i-2]&&s[i]==s[i-1]) {
    s[i]=s[i-1];
    s[i-1]=s[i-2];
    continue;
    }
    else
    if(i>=3)  {
    if(s[i]==s[i-1]&&s[i-2]==s[i-3]) {
    s[i]=s[i-1];
    s[i-1]=s[i-2];
           s[i-2]=s[i-3];
    }
    else
    printf("%c",s[i]);
    }
    else
    printf("%c",s[i]);
    }
    printf(" ");
    }
    return 0;
    }




  • 相关阅读:
    场景调研
    12.8
    12.7
    12.6
    12.5
    12.4
    12.3
    重启oracle数据库的操作方法
    oracle创建dblink方法
    SQL*Loader 详解
  • 原文地址:https://www.cnblogs.com/thefirstfeeling/p/4410913.html
Copyright © 2020-2023  润新知