Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main() {
- while( (current = getchar()) != EOF ) {
- current = toupper(current) ;
- if( current >= 65 && current <= 90 ) {
- count[current]++ ;
- }
- if( count[current] > max ) {
- max = count[current] ;
- }
- }
- for( i = 0; i < sizeof(count); i++ ) {
- int var = count[i] + 65 ;
- printf( "%c", var ) ;
- print_stars(count[i]) ;
- }
- return 0 ;
- }
- /*
- * Print out 'ns' stars (asterisks)
- */
- void print_stars( int ns ) {
- int stars = (( MAXSTARS * ns )/ max ) ;
- for( x = 0; x < stars; x++ ) {
- printf("*") ;
- }
- return ;
- }
Add Comment
Please, Sign In to add comment