package lanqiao;
import java.util.Scanner;
public class N504 {
static int[] count = new int[26];
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String s = scanner.nextLine();
for (int i = 0; i < s.length(); i++) {
count[s.charAt(i) - 'a']++;
}
int max = 0;
for (int i = 0; i < count.length; i++) {
if (max < count[i]) {
max = count[i];
}
}
for (int i = 0; i < count.length; i++) {
if (max == count[i]) {
System.out.println((char) (i + 'a'));
System.out.println(count[i]);
break;
}
}
}
}
标签:分析,count,Scanner,int,max,System,单词,++
From: https://www.cnblogs.com/ChuenSan/p/17216065.html