1-14

xiaoxiao2021-03-06  51

/ * 1-14 Write a program, the histogram of the frequency of each character in the print input * /

#include

#include

Int main (void)

{

Int A, Array [26];

For (a = 0; a <26; a ) array [a] = 0;

A = 0;

While ((a = getchar ())! = EOF)

{

IF (a> = 'a' && a <= 'z') Array [A-'A '] ;

IF (a> = 'a' && a <= 'z') Array [A-'A '] ;

}

For (a = 0; a <26; a )

{

INT b = array [a];

Printf ("% C is:", A 'a');

For (; b> 0; b -) Printf ("*");

Printf ("/ n");

}

System ("pause");

Return 0;

}

转载请注明原文地址:https://www.9cbs.com/read-118649.html

New Post(0)