-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path59A - Word
More file actions
44 lines (42 loc) · 855 Bytes
/
Copy path59A - Word
File metadata and controls
44 lines (42 loc) · 855 Bytes
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
// IN THE NAME OF ALLAH ^_^
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
using namespace std;
int main ()
{
string s;
cin >> s;
int capital=0, small=0;
for (int i=0; i<s.length(); i++){
if (s[i]>='A' && s[i]<='Z'){
capital++;
}
else {
small++;
}
}
if (capital>small){
for (int j=0; j<s.length(); j++){
if (s[j]>='a' && s[j]<='z'){
s[j]-=32;
}
}
}
else if (small>capital){
for (int j=0; j<s.length(); j++){
if (s[j]>='A' && s[j]<='Z'){
s[j]+=32;
}
}
}
else {
for (int j=0; j<s.length(); j++){
if (s[j]>='A' && s[j]<='Z'){
s[j]+=32;
}
}
}
cout << s;
}