#include <stdio.h>
int main()
{
/* Write C code in this online editor and run it. */
char ch;
int i=0;
int k=0;
int num[26]={0};
printf("Input 字串:");
ch=getchar();
while(ch!='\n')//判斷是否輸入回車
{
if(ch<='z'&&ch>='a')
{
k=ch-'a';
num[k]=num[k]+1;
}
ch=getchar();
}
for(i=0;i<=25;i++)
{
if(num[i]!=0)
{
printf("num of %c is %d\n",i+'a',num[i]);
}
}
}