Nathan Coulas

Back to School '16: Harambe

bts16p1 JAVA8 18 Dec, 2019 1.682s 3 points

Source Code

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args)throws java.io.IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String m = br.readLine();
        char[] characters = m.toCharArray();
        int upperCount = 0, lowerCount = 0, curr;
     
        for(int i = 0; i < m.length(); i++){
            curr = (int)characters[i];
            if(curr > 90){
                lowerCount++;
            }else if(curr > 64){
                upperCount++;
            }
        }

        if(upperCount > lowerCount){
            System.out.println(m.toUpperCase());
        }else if(lowerCount > upperCount){
            System.out.println(m.toLowerCase());
        }else{
            System.out.println(m);
        }
 
    }
  
    
}