Guest User

Untitled

a guest
Apr 22nd, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. int main() {
  2.  
  3. while( (current = getchar()) != EOF ) {
  4. current = toupper(current) ;
  5. if( current >= 65 && current <= 90 ) {
  6. count[current]++ ;
  7. }
  8. if( count[current] > max ) {
  9. max = count[current] ;
  10. }
  11. }
  12. for( i = 0; i < sizeof(count); i++ ) {
  13. int var = count[i] + 65 ;
  14. printf( "%c", var ) ;
  15. print_stars(count[i]) ;
  16. }
  17. return 0 ;
  18. }
  19.  
  20. /*
  21. * Print out 'ns' stars (asterisks)
  22. */
  23.  
  24. void print_stars( int ns ) {
  25.  
  26. int stars = (( MAXSTARS * ns )/ max ) ;
  27. for( x = 0; x < stars; x++ ) {
  28. printf("*") ;
  29. }
  30. return ;
  31. }
Add Comment
Please, Sign In to add comment