Advertisement
Falak_Ahmed_Shakib

k koto bar asa

Jul 18th, 2019
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. int main()
  4. {
  5. int n;
  6. scanf("%d",&n);
  7. while(n--)
  8. {
  9. int count[26]={0};
  10.  
  11. char str[1000];
  12. scanf("%s",str);
  13. int i;
  14.  
  15. for(i=0;str[i];i++)
  16. {
  17. if(str[i]>='a' && str[i]<='z')
  18. {
  19. count[str[i]-'a']++;
  20. }
  21. }
  22.  
  23. for(i=0; i<26; i++)
  24. if(count[i]!=0)
  25.  
  26. {
  27. printf("%c = %d\n",'a'+i,count[i]);
  28. }
  29.  
  30. }
  31.  
  32.  
  33.  
  34. return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement