标签:style blog io color os for sp strong 数据
描述
3 BBRRWBWRRR RRRWWRWRB RBRW
RRRRRWWBBB RRRRRWWWB RRWB
#include <iostream> #include <string> using namespace std; int main(void) { int n; string str; int c1,c2,c3; cin>>n; while(n--){ cin>>str; c1=0,c2=0,c3=0; int m = str.size(); for(int i=0;i<m;i++) { if(str[i]==‘B‘) c1 ++; if(str[i]==‘W‘) c2 ++; if(str[i]==‘R‘) c3 ++; } for(int i=0;i<c3;i++) cout<<‘R‘; for(int i=0;i<c2;i++) cout<<‘W‘; for(int i=0;i<c1;i++) cout<<‘B‘; cout<<endl; } return 0; }
标签:style blog io color os for sp strong 数据
原文地址:http://www.cnblogs.com/imwtr/p/4069555.html