Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*Problem 13 GROUP 3*/
- #include <stdio.h>
- #include <stdlib.h>
- int main(){
- char* s1=(char*)malloc(1000);
- printf("Input String 1 : ");
- scanf("%s",s1);
- int* count=(int*)calloc(sizeof(int),256);
- int x=0;
- while(s1[x]!='\0'){
- if(s1[x]>='A' && s1[x]<='Z')s1[x]+=('a'-'A');
- count[s1[x]]++;
- //printf("%c\n",s1[x]);
- x++;
- }
- for(x=0;x<256;x++){
- if(count[x]>0){
- printf("%c >> %d\n", x,count[x]);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement