/
Word
36 lines (36 loc) · 790 Bytes
/
Word
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
import java.util.Scanner;
import java.util.Arrays;
import java.util.*;
import java.util.*;
import java.io.*;
public class Team
{
public static String lo_up(String word){
int counter_upper =0;
int counter_lower =0;
String result = "";
StringBuilder s = new StringBuilder(result);
for(int i=0; i < word.length();i++){
if(word.charAt(i) >= 97 & word.charAt(i) <= 122){
counter_lower++;
}
else{
counter_upper++;
}
}
if(counter_upper <= counter_lower){
result = word.toLowerCase();
}
else{
result = word.toUpperCase();
}
return result;
}
public static void main(String[]args) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
PrintWriter pr = new PrintWriter(System.out);
String word = br.readLine();
pr.println(lo_up(word));
pr.flush();
}
}