C语言萌新求各位大神解答

主函数main()中分别输入不超过30个字符的字符串和一个字符,子函数int FindChar(char ch,char str[])查找字符ch在字符串str中出现的个数并返回给主函数main(),主函数main()输出ch在字符串str中出现的个数 。

#include <stdio.h>
#include <string.h>

int FindChar(char ch, char str[]);

int main()
{
    char strs[31];
    char str;
    scanf("%c", &str);
    getchar();
    gets(strs);

    printf("%d\n", FindChar(str, strs));

    getchar();
    return 1;
}

int FindChar(char ch, char str[])
{
    int i;
    int count = 0;
    for(i=0;i<strlen(str);i++)
    {
        if(ch == str[i])
            count++;
    }
    return count;
}