Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #define MAX_CHAR_SIZE 1000
- int convert(char c){
- return (c<91)?c-'A':c-'a';
- }
- int main(int argc, const char * argv[])
- {
- int n = 0, Num_of_alphabet[26];
- int i = 0;
- char Sentence[MAX_CHAR_SIZE];
- for(; i<26; i++)
- Num_of_alphabet[i] = 0;
- scanf("%d",&n);
- int c=0;
- while(c<=n)
- {
- gets(Sentence);
- i=0;
- while(Sentence[i]!='\0')
- Num_of_alphabet[convert(Sentence[i++])]++;
- c++;
- }
- for(i=0; i<26; i++)
- printf("%c %d\n",i+'A',Num_of_alphabet[i]);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment