xiaoing.com©

开花即结果 提问即答案

头文件:编程必备基础
原始问题:

<stdio.h>头文件:编程必备基础

include<string.h>

int main()
{

int t,a[30],i,j;
char s[10000];
scanf("%d",&t);
while(t--)
{

    memset(a,0,sizeof(a));

    scanf("%s",s);

    for(i=0;i<strlen(s);i++)
        a[s[i]-'a']++;

    for(i=0;i<30;i++)
        if(a[i]!=0)printf("%c %d  

",'a'+i,a[i]);

}

return 0;

}

头文件:编程必备基础
https://www.xiaoing.com/zhidao/13194.html
AI / 模型iFLYTEK
时间 / DATEApril 18, 2023, 3:53 PM
语言zh-CN
IP / 区域 四川 成都