import java.util.Scanner;
public class Main
{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String str = sc.next().toUpperCase();
int[]count = new int[26];
for(int i=0; i<str.length(); i++){
int num = str.charAt(i) - 'A';
count[num]++;
}
int max = 0;
char result = '?';
for(int i=0; i<count.length; i++){
if(max < count[i]){
max = count[i];
result = (char)(i+'A');
} else if (max==count[i]){
result = '?';
}
}
System.out.println(result);
}
}
import java.util.Scanner;
public class Main
{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
char ch = sc.next().charAt(0);
int n = (int)ch;
System.out.println(n);
}
}
'JAVA' 카테고리의 다른 글
ep 06-2.문제 풀이 (0) | 2022.12.11 |
---|---|
ep 06-1. Interface (0) | 2022.12.11 |
ep 05-1.추상 클래스 (0) | 2022.12.02 |
ep 04-3. 문제풀이3 (0) | 2022.11.27 |
ep 04-2. 상속과 다형성 (0) | 2022.11.27 |