-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathword.cpp
More file actions
57 lines (55 loc) · 1.25 KB
/
Copy pathword.cpp
File metadata and controls
57 lines (55 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ar array
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define rep(n) for (int i = 0; i < n; i++)
#define FOR(i, x, y) for (int i = x; i < y; i++)
#define DEC(i, x, y) for (int i = x; i >= y; i--)
typedef pair<int,int> ii;
typedef map<int,int> mp;
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
string s;
cin>>s;
int countU=0;
int countL=0;
for(int i=0;i<s.size();i++){
if(s[i]>=65 and s[i]<=90){
countU+=1;
}
}
for(int i=0;i<s.size();i++){
if(s[i]>=97 and s[i]<=122){
countL+=1;
}
}
if(countU<countL){
rep(s.size()){
if(s[i]>=65 and s[i]<=90){
s[i]+=32;
}
}
cout<<s;
}
else if(countL<countU){
rep(s.size()){
if(s[i]>=97 and s[i]<=122){
s[i]-=32;
}
}
cout<<s;
}
else{
rep(s.size()){
if(s[i]>=65 and s[i]<=90){
s[i]+=32;
}
}
cout<<s;
}
return 0;
}