Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int n;
- scanf("%d",&n);
- while(n--)
- {
- int count[26]={0};
- char str[1000];
- scanf("%s",str);
- int i;
- for(i=0;str[i];i++)
- {
- if(str[i]>='a' && str[i]<='z')
- {
- count[str[i]-'a']++;
- }
- }
- for(i=0; i<26; i++)
- if(count[i]!=0)
- {
- printf("%c = %d\n",'a'+i,count[i]);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement