标签:++ include lse clu turn std define else def
#include <stdio.h> #include <string.h> #include <stdbool.h> #define Maxsize 210 int main() { char sentence[Maxsize]; char wub[4]={‘W‘, ‘U‘, ‘B‘}; scanf("%s", sentence); int length=strlen(sentence); int i; int j; int ind=0; bool first=true; bool done=false; for(i=0; i<length; ) { if(sentence[i]==wub[ind]) { ++i; ++ind; } else { if(ind==0) ++i; ind=0; } if(ind==3) { ind=0; sentence[i-1]=sentence[i-2]=sentence[i-3]=‘.‘; } } for(i=0; i<length; ++i) { if(sentence[i]==‘.‘) done=true; else { if((!first)&&(done)) printf(" "); printf("%c", sentence[i]); first=false; done=false; } } printf("\n"); return 0; }
标签:++ include lse clu turn std define else def
原文地址:https://www.cnblogs.com/ozxics/p/11118354.html