forked from Sanchitbajaj02/CppPrograms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathword.cpp
More file actions
39 lines (39 loc) · 734 Bytes
/
word.cpp
File metadata and controls
39 lines (39 loc) · 734 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
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define float long double
#define f(i,a,b) for(int i = a;i < b;i++)
#define ff(i,a,b) for(int i = a-1;i>=b;i--)
#define endl '\n'
#define IOS ios_base::sync_with_stdio(false), cin.tie(NULL)
const int mod = 1e9+7;
//int to string -> to_string()
//string to int -> stoi()
int32_t main()
{ IOS;
string s;
cin>>s;
int l,i,c1=0,c2=0;
l=s.length();
for(i=0;i<l;i++)
{
if(isupper(s[i]))
c1++;
else
c2++;
}
if(c1>c2)
{for(i=0;i<l;i++)
{
if(islower(s[i]))
s[i]=toupper(s[i]);}
}
else
{ for(i=0;i<l;i++)
{
if(isupper(s[i]))
s[i]=tolower(s[i]); }
}
cout<<s;
return 0;
}