-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path59A.c
More file actions
46 lines (41 loc) · 759 Bytes
/
59A.c
File metadata and controls
46 lines (41 loc) · 759 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
45
46
#include <stdio.h>
#include <string.h>
int main()
{
char t[100];
scanf("%s",t);
int n=strlen(t),u=0,l=0;
for (int i=0;i<n;i++)
{
if ( t[i]>='A' && t[i]<='Z' )
{
u++;
}
else if (t[i]>='a' && t[i]<='z')
{
l++;
}
}
if ( l>u || l==u)
{
for (int j=0;j<n;j++)
{
if ( t[j]>='A' && t[j]<='Z' )
{
t[j]=t[j]+32;
}
}
}
else if (u>l)
{
for (int k=0;k<n;k++)
{
if ( t[k]>='a' && t[k]<='z' )
{
t[k]=t[k]-32;
}
}
}
printf("%s",t);
return 0;
}