package test;
public class project1 {
	public static void main(String []args) {
       char[] chars=createArray();
       int[] counts=countLetters(chars);
       System.out.println("the occurrences of each letter are:");
	public static char[] createArray() {
		char[] chars=new char[100];
		for(int i=0;i<chars.length;i++) 
		return chars;
	public static int[] countLetters(char[] chars) {
		int[] counts=new int[26];
		for(int i=0;i<chars.length;i++)
		return counts;
	public static void displayArray(char[] chars) {
		for(int i=0;i<chars.length;i++) {
			if((i+1)%10==0) {
				System.out.print(chars[i]+" ");
	public static void displayCount(int[] counts) {
		for(int i=0;i<counts.length;i++) {
			if((i+1)%10==0) {
				System.out.println((char)(i+'a')+" "+counts[i]);
				System.out.print((char)(i+'a')+" "+counts[i]+"   ");


s e d g z r o p i j
g w d s h l n z z f
w g j n y g z q c v
t w f z h t w a n l
a m u s i t c d e k
n k b h b p a e r f
g b d m j e q g y t
v z c b n h o k m n
k s q v d w o i w n
e o x p m h s g w j
the occurrences of each letter are:
a 3   b 4   c 3   d 5   e 5   f 3   g 7   h 5   i 3   j 4
k 4   l 2   m 4   n 7   o 4   p 3   q 3   r 2   s 5   t 4
u 1   v 3   w 7   x 1   y 2   z 6   


已标记关键词 清除标记
©️2020 CSDN 皮肤主题: 书香水墨 设计师:CSDN官方博客 返回首页