??
作者:
huwahuwa
,
2021-09-12 19:10:18
,
所有人可见
,
阅读 234
#include <bits/stdc++.h>
using namespace std;
int n,q;
int main()
{
cin>>n;
q = n*3;
int t[q];
char s[n][101];
for (int i = 0; i < n; i ++ ){
fgets(s[i],101,stdin);
for (int j = 0; j <101; j ++ ){
if(s[i][j]<91)
{
t[i] ++ ;
}
else
{t[i+n+1] ++;}}}
for (int i = 0; i < n; i ++ ){
if(t[i] > t[i+n]){
for (int j = 0; j < 101; j ++ )
if(s[i][j]>91)
{s[i][j]=toupper(s[i][j]);}
else
for(int j = 0; j < 101; j++)
if(s[i][j]<91)
{s[i][j]=tolower(s[i][j]);
}}
for (int i = 0; i < n; i ++ ){
for (int j = 0; j < 101; j ++ )
{printf("%c", s[i][j]);}}
return 0;
}}