Java 代码
import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner in = new Scanner(System.in);
String s = in.nextLine();
int[] a = new int[26];
int max = 0;
int z = 0;
for (int i = 0; i < s.length(); i++) {
int j = s.charAt(i) - 97;
a[j]++;
}
for(int i = 0;i < a.length;i++){
if(a[i] > max){
max = a[i];
z = i;
}
}
System.out.println((char)(z + 97));
System.out.println(max);
}
}