Count the number of occurrences of each letter in string

前端 未结 15 2013
别跟我提以往
别跟我提以往 2020-12-10 20:02

How can I count the number of occurrences in c of each letter (ignoring case) in the string? So that it would print out letter: # number of occurences, I have c

15条回答
  •  半阙折子戏
    2020-12-10 20:38

    //c code for count the occurence of each character in a string.

    void main()
       {
       int i,j; int c[26],count=0; char a[]="shahid";
       clrscr();
       for(i=0;i<26;i++)
        {
            count=0;
              for(j=0;j

提交回复
热议问题