Advertisement
Guest User

Untitled

a guest
Dec 19th, 2014
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.38 KB | None | 0 0
  1. alphabet_vector[26] = {0}
  2. most_common_char_counter = 0
  3.  
  4. for (input_counter = 0; input_conuter < 20; input_conuter++)
  5. {
  6.     c = getchar()
  7.     alphabet_vector[c - 'a']++
  8.    
  9.     if (alphabet_vector[c - 'a'] > most_common_char_count)
  10.     {
  11.         most_common_char_count = alphabet_vector[c - 'a']
  12.         most_common_char = c
  13.     }
  14. }
  15.  
  16. print most common char is most_common_char
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement