每个测试文件均包含多组测试数据。第一行输入一个整数
代表数据组数,每组测试数据描述如下:
输入一个长度为
,仅包含小写字母的字符串
。
对于每一组测试数据,新起一行,输出修改后的字符串。
4 abcdefg vwcvnwaomy ovoxcfdtf yynbve
ABcDefG VWcVnwAOmy OVoXcfDTf YYnBve
#include <bits/stdc++.h>
using namespace std;
int fun(int x){
return x & -x;
}
int main() {
int n,j=0;
cin>>n;
int c[500];
for(int i=1;i<=500;i++){
int m=i;
int t=0;
while(m>0){
t++;
m-=fun(m);
}
if(t%2!=0) {
c[j++]=i;
}
}
while(n--){
string u;
cin>>u;
int q=0;
while(c[q]-1<u.size()){
u[c[q]-1]=u[c[q]-1]-32;
q++;
}
cout<<u<<endl;
}
return 0;
}