#include <stdio.h>
#include <ctype.h>
#include <string.h>
#define MAXSIZE 100
int letters = 0, digits = 0, others = 0;
void fun1(char s[])
{
int m;
int ch;
m = strlen(s);
for (ch = 0; ch < m; ch++)
{
if (isalpha(s[ch]))
{
letters++;
}
else if (isdigit(s[ch]))
{
digits++;
}
else
{
others++;
}
}
}
int main()
{
void fun1(char l[]);
int fun2(int nn);
int key, n, a, b;
char s[MAXSIZE];
printf("请输入密码:");
scanf("%d", &key);
if (key == 123)
{
printf("********\n");
printf("1.字符分类统计\n");
printf("2.打印自定义菱形\n");
printf("********\n");
printf("请输入指令");
scanf("%d", &n);
switch (n)
{
case 1:
{
printf("请输入字符串:");
scanf("%c", &s);
fun1(s);
printf("\n统计结果:\n字母=%d \n数字=%d \n其他=%d", letters, digits, others);
return 0;
break;
}
}
}
else
printf("密码错误");
}
第57行是%s,写成%c了