package test;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
int a = 0;
int b = 0;
int c = 0;
int d = 0;
int e = 0;
int f = 0;
int g = 0;
int h = 0;
int k = 0;
int l= 0;
Scanner s=new Scanner(System.in);
String input=s.nextLine();
char[]arr=input.toCharArray(); //转换为数组
//统计各个数字频率
for (int i = 0; i < arr.length; i++) {
switch(arr[i]){
case '0':a++;break;
case '1':b++;break;
case '2':c++;break;
case '3':d++;break;
case '4':e++;break;
case '5':f++;break;
case '6':g++;break;
case '7':h++;break;
case '8':k++;break;
case '9':l++;break;
}
}
int[]arr2={a,b,c,d,e,f,g,h,k,l};
int max = arr2[0];
int index=0;
for(int j=0;j<arr2.length;j++){
if(arr2[j]>max){
max=arr2[j];
index=j;
}
}
System.out.println("出现次数最多的是:"+index);
System.out.println("出现的次数是:"+max);
}
}
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
int a = 0;
int b = 0;
int c = 0;
int d = 0;
int e = 0;
int f = 0;
int g = 0;
int h = 0;
int k = 0;
int l= 0;
Scanner s=new Scanner(System.in);
String input=s.nextLine();
char[]arr=input.toCharArray(); //转换为数组
//统计各个数字频率
for (int i = 0; i < arr.length; i++) {
switch(arr[i]){
case '0':a++;break;
case '1':b++;break;
case '2':c++;break;
case '3':d++;break;
case '4':e++;break;
case '5':f++;break;
case '6':g++;break;
case '7':h++;break;
case '8':k++;break;
case '9':l++;break;
}
}
int[]arr2={a,b,c,d,e,f,g,h,k,l};
int max = arr2[0];
int index=0;
for(int j=0;j<arr2.length;j++){
if(arr2[j]>max){
max=arr2[j];
index=j;
}
}
System.out.println("出现次数最多的是:"+index);
System.out.println("出现的次数是:"+max);
}
}