Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio>
- #include <conio>
- #include <stdlib>
- #include <iostream>
- #include <windows>
- #include <locale>
- int main()
- {
- system("color 0F");
- char arr[256]; int c[52]= {0};
- printf("Enter the string:\n");
- fgets(arr, 256,stdin);
- int len= strlen(arr); len--;
- int b; int code; int a;
- for (b=0; b<len; b++)
- {
- code= arr[b];
- if ((code>64)&&(code<91)) { code-=65; goto zzz; }
- if ((code>96)&&(code<123)) { code-=71; }
- zzz:
- c[code]++;
- }
- for (b=0; b<52; b++)
- {
- a= c[b];
- if (a!=0)
- {
- if (b<26) code= b+65;
- else code= b+71;
- printf("%c %d\n", code, a);
- }
- }
- getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement