文章
2
粉丝
325
获赞
2
访问
20.0k
#include<stdio.h>
int main()
{
char c[1000] = { '\0' };
char m[26] = {"abcdefghijklmnopqrstuvwxyz"};
int i,j,n;
int count[26] = {0};
scanf("%d", &n);
for (i = 0; i <= n; i++)
scanf("%c", &c[i]);
for (j = 0; j < 26; j++)
{
for (i = 0; i <= n; i++)
{
if (c[i] == m[j])
count[j]++;
}
if ((count[j] != 0) && (count[j] % 5 == 0 || count[j] % 7 == 0))
printf("%c %d\n", m[j]...
登录后发布评论
不能写成char m[26] = {"abcdefghijklmnopqrstuvwxyz"};这样吧,改成下面这样:
char m[26] = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
char类型是一个字符一个字符的存的。