C内嵌汇编语言 编写 输入一个字符,它能判断出是大小写字母还是数字 10
Pleaseinputanalpha-numericalcharacter:aLowercasePleaseinputanalpha-numericalcharacter...
Please input an alpha-numerical character: a Lowercase
Please input an alpha-numerical character: G Uppercase
Please input an alpha-numerical character: 1 Odd
Please input an alpha-numerical character: 8 Even
Please input an alpha-numerical character: / Exiting
Looped 4 times:
The number of lowercase characters is 1. The number of uppercase characters is 1. The number of odd numbers is 1.
The number of even numbers is 1. 展开
Please input an alpha-numerical character: G Uppercase
Please input an alpha-numerical character: 1 Odd
Please input an alpha-numerical character: 8 Even
Please input an alpha-numerical character: / Exiting
Looped 4 times:
The number of lowercase characters is 1. The number of uppercase characters is 1. The number of odd numbers is 1.
The number of even numbers is 1. 展开
1个回答
2016-10-18
展开全部
输入一个字符,它能判断出是大小写字母还是数字
这个可以
scanf("%c", &n);
if(n>='a' && a<='z'){
printf("小写字母\r\n");
}else if(n>='A' && a<='A'){
printf("大写字母\r\n");
}else if(n>='0' && a<='9'){
printf("数字\r\n");
if(n%2==0){
printf("偶数\r\n");
}else{
printf("奇数\r\n");
}
}
等
这个可以
scanf("%c", &n);
if(n>='a' && a<='z'){
printf("小写字母\r\n");
}else if(n>='A' && a<='A'){
printf("大写字母\r\n");
}else if(n>='0' && a<='9'){
printf("数字\r\n");
if(n%2==0){
printf("偶数\r\n");
}else{
printf("奇数\r\n");
}
}
等
追问
用c语言我也会呀,我要问的是用c的内嵌汇编怎么做。。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |