ACAC
2023-12-23 21:42:35
发布于:广东
5阅读
0回复
0点赞
#include <bits/stdc++.h>
using namespace std;
void Aa(char &x){
if(x >= 'A' and x <= 'Z'){
x += 32;
}else if(x >= 'a' and x <= 'z'){
x -= 32;
}
}
int main(){
int a;
string s;
cin >> a;
while(a--){
cin >> s;
int len = s.size();
for(int i = 0; i < len; i++){
if(i == 0 and s[i] >= 'a' and s[i] <= 'z'){
Aa(s[i]);
}else if(i != 0 and s[i] >= 'A' and s[i] <= 'Z'){
Aa(s[i]);
}
}
cout << s << endl;
}
return 0;
}
这里空空如也
有帮助,赞一个