![](https://iknow-base.cdn.bcebos.com/lxb/notice.png)
C语言 输入一个字符,判断该字符是数字、字母、空格还是其他字符。
main(){charch;ch=getchar();if(____________________________________________)printf("It...
main( )
{
char ch;
ch=getchar();
if(____________________________________________)
printf("It is an English character\n");
else if(______________________)
printf("It is a digit character\n");
else if(______________)
printf("It is a space character\n");
else
printf("It is other character\n"); }
三个条件该怎么填? 展开
{
char ch;
ch=getchar();
if(____________________________________________)
printf("It is an English character\n");
else if(______________________)
printf("It is a digit character\n");
else if(______________)
printf("It is a space character\n");
else
printf("It is other character\n"); }
三个条件该怎么填? 展开
展开全部
# coding=utf-8
x=raw_input("")
if(x>='0')&(x<='9'):
print ("是数字")
elif((x.lower()>='a')&(x.lower()<='z')):
print ("是字母")
elif(x==' '):
print ("是空格")
else :
print("是其他")
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
加上ch=getchar();后输出的实际上是enter键
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询