判断字符串中n的个数(c语言)

帮帮忙吧大佬们,我实在是不会了,学生党一枚,没钱发悬赏😭

n是什麽啊?是某个字符吗?

#include <stdio.h>
int main()
{
    char s[1000];
    int i=0,count=0;
    char n;
    gets(s);
    n = getchar();
    while(s[i] != '\0')
    {
        if(s[i] == n)
            count++;
        i++;
    }
    printf("%d",count);
    return 0;
}

您好,我是有问必答小助手,您的问题已经有小伙伴帮您解答,感谢您对有问必答的支持与关注!
PS:问答VIP年卡 【限时加赠:IT技术图书免费领】,了解详情>>> https://vip.csdn.net/askvip?utm_source=1146287632