标签:style http io ar color os sp for on
3 BBRRWBWRRR RRRWWRWRB RBRW
RRRRRWWBBB RRRRRWWWB RRWB
#include<stdio.h> #include<string.h> int main() { int n,i; char str[1010]; scanf("%d",&n); while(n--) { scanf("%s",str); int len = strlen(str),b,r,w; r=b=w=0; for(i=0;i<len;++i) { if(str[i]=='B') b++; else if(str[i]=='R') r++; else w++; } while(r--) printf("R"); while(w--) printf("W"); while(b--) printf("B"); printf("\n"); } return 0; }
标签:style http io ar color os sp for on
原文地址:http://blog.csdn.net/qq_18062811/article/details/41770523