判断一个正整数是否是两位数(即大于等于10且小于等于99)
要求:一个正整数,不超过100
#include <stdio.h>
#include <math.h>
int main()
{
unsigned short b; //无符号短性 占位符%hu
scanf("%hu",&b);
if(10<=b && b<=99)
{
printf("1");
}
else
{
printf("0");
}
return 0;
}
判断一个正整数是否是两位数(即大于等于10且小于等于99)
要求:一个正整数,不超过100
#include <stdio.h>
#include <math.h>
int main()
{
unsigned short b; //无符号短性 占位符%hu
scanf("%hu",&b);
if(10<=b && b<=99)
{
printf("1");
}
else
{
printf("0");
}
return 0;
}