Advertisement
Guest User

Untitled

a guest
May 26th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. #include <stdio>
  2. #include <conio>
  3. #include <stdlib>
  4. #include <iostream>
  5. #include <windows>
  6. #include <locale>
  7.  
  8. int main()
  9. {
  10. system("color 0F");
  11.  
  12. char arr[256]; int c[52]= {0};
  13.  
  14. printf("Enter the string:\n");
  15. fgets(arr, 256,stdin);
  16.  
  17. int len= strlen(arr); len--;
  18.  
  19. int b; int code; int a;
  20. for (b=0; b<len; b++)
  21. {
  22. code= arr[b];
  23. if ((code>64)&&(code<91)) { code-=65; goto zzz; }
  24. if ((code>96)&&(code<123)) { code-=71; }
  25. zzz:
  26. c[code]++;
  27. }
  28.  
  29. for (b=0; b<52; b++)
  30. {
  31. a= c[b];
  32. if (a!=0)
  33. {
  34. if (b<26) code= b+65;
  35. else code= b+71;
  36. printf("%c %d\n", code, a);
  37. }
  38. }
  39.  
  40. getch();
  41. return 0;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement