📄 third.java
字号:
import java.util.Scanner;
public class third
{
public static void main(String[] args)
{
int i=0,max=0,mc=0;
Scanner scan=new Scanner(System.in);
String st[]=new String[20];
do
{
st[i]=scan.next();
}while(!st[i++].equals("#"));
int count[]=new int[i];
for(int j=0;j<i-1;j++)
{
for(int k=j+1;k<i;k++)
{
if(st[j].equals(st[k]))
{
count[j]++;
if(max<count[j])
{
max=count[j];
mc=j;
}
}
}
}
System.out.println("The max string is "+st[mc]);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -