http://codeforces.com/contest/59

A

 1 #include<bits/stdc++.h>
 2 using namespace std;
 3 #define lson l,mid,rt<<1
 4 #define rson mid+1,r,rt<<1|1
 5 #define sqr(x) ((x)*(x))
 6 #define pb push_back
 7 #define eb emplace_back
 8 #define maxn 1000005
 9 #define rep(k,i,j) for(int k=i;k<j;k++)
10 typedef long long ll;
11 typedef unsigned long long ull;
12 
13 
14 int main(){
15     #ifndef ONLINE_JUDGE
16        // freopen("input.txt","r",stdin);
17     #endif
18     std::ios::sync_with_stdio(false);
19     string str;
20     cin>>str;
21     int big=0,small=0;
22     for(int i=0;i<str.length();i++){
23         if(str[i]>='A'&&str[i]<='Z'){
24             big++;
25         }
26         else{
27             small++;
28         }
29     }
30     if(big<=small){
31         for(int i=0;i<str.length();i++){
32             if(str[i]>='A'&&str[i]<='Z'){
33                 str[i]+=32;
34             }
35             cout<<str[i];
36         }
37     }
38     else{
39        for(int i=0;i<str.length();i++){
40             if(str[i]>='a'&&str[i]<='z'){
41                 str[i]-=32;
42             }
43             cout<<str[i];
44         } 
45     }
46 }
View Code

相关文章: