2024-06-25 12:47:10
2024-06-25 00:39:44
2024-06-25 03:12:15
2024-06-25 13:38:13
你那能调试出来不呀
能
能不能弄个简单易懂的呀?
#include
void count(char *s, int *digit, int *letter, int *other)
{
int i;
for(i=0;s[i]!='\0';i++)
{
if(s[i]>='a'&&s[i]='A'&&s[i]'0'&&s[i]<'9')
(*digit)++;
else
(*other)++;
}
}
void main()
{
int x=0,y=0,z=0;
char ch[80];
printf("Enter a string:");
gets(ch);
count(ch,&x,&y,&z);
printf("数字有:%d个,字母有:%d个,其它符号有:%d个\n",x,y,z);
}这个够简单了吧