题解 A96425.大小写变换
2026-03-27 20:22:25
发布于:广东
13阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
string s;
int a,b;
int main(){
cin>>s;
//islower()判断小写 isupper()判断大写 tolower()转小写 toupper()转大写
for(int i=0;i<s.size();i++){
if(islower(s[i]))a++;
else b++;
}
if(a>=b)
for(int i=0;i<s.size();i++)s[i]=tolower(s[i]);
else
for(int i=0;i<s.size();i++)s[i]=toupper(s[i]);
cout<<s;
}
这里空空如也




有帮助,赞一个