输不出来字母跟数字到底哪错了啊
其他问答
1
#include<stdio.h>
int main)
{
intupper, lower, digit, i;
char ch;
upper=lower=digit=0;
printf(“输入10个字符:”)
for (i=1;i<=10;i++)
{
ch=getchar();
if (ch> 'a'&&ch<='z')
lower It+;
else if (ch>='A'&& Z°)
upper++
else if (ch>='0'&&'91)
digit ++;
printf(小写字母%d个,大写字母d%个,数字%d个”):
return 0;
-
#include<stdio.h> int main() { int upper, lower, digit, i; char ch; upper=lower=digit=0; printf("输入10个字符:"); for (i=1;i<=10;i++) { ch=getchar(); if (ch>= 'a'&&ch<='z') lower++; else if (ch>='A'&& ch <='Z') upper++; else if (ch>='0'&&ch <= '9') digit ++; } printf("小写字母%d个,大写字母%d个,数字%d个",lower,upper,digit); return 0; }
-
#include<stdio.h> int main() { int upper, lower, digit, i; char ch; upper=lower=digit=0; printf("输入10个字符:"); for (i=1;i<=10;i++) { ch=getchar(); if (ch>= 'a'&&ch<='z') lower ++; else if (ch>='A'&& ch<='Z') upper++; else if (ch>='0'&&ch<=91) digit ++; } printf("小写字母%d个,大写字母%d个,数字%d个",lower,upper,digit); return 0; }
发表回复