-
Notifications
You must be signed in to change notification settings - Fork 0
/
59A - Word.cpp
66 lines (48 loc) · 1017 Bytes
/
59A - Word.cpp
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
58
59
60
61
62
63
64
65
66
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <cstdlib>
#define ll long long
#define pi 3.14159265359
#define yes std::cout << "YES" << endl
#define no std::cout << "NO" << endl
using namespace std;
void solve();
int main() {
solve();
return 0;
}
void solve() {
ios::sync_with_stdio(false);
cin.tie(NULL);
string s;
cin >> s;
int lower = 0;
int upper = 0;
for (int i = 0; i < s.length(); i++) {
if (int(s[i]) >= 97) {
lower++;
} else {
upper++;
}
}
if (upper > lower) {
for (int i = 0; i < s.length(); i++) {
if (int(s[i]) < 97) {
} else {
s[i] = s[i] - 32;
}
}
cout << s;
} else {
for (int i = 0; i < s.length(); i++) {
if (int(s[i]) > 96) {
} else {
s[i] = s[i] + 32;
}
}
cout << s;
}
}