输入一段中英文混合的字符串 自动统计其中的英文字母出现频率 忽略大小写

import java.util.Scanner;
public class Main {
	public static void main(String args[]) {
		String str1,str2;						//定义两个String的变量 str1和str2
		int ary[]=new int[26];					//定义一个新的数组ary[] 其中有26个字母
		Scanner sca=new Scanner(System.in);
		str1=sca.nextLine();					//读取一行	
		str2=str1.trim().toLowerCase().replaceAll("[^a-y]","");			//trim()表示去掉字符串两端的多余的空格 并且中间的空格不去除
		
		for(int i=0;i

你可能感兴趣的:(输入一段中英文混合的字符串 自动统计其中的英文字母出现频率 忽略大小写)