1. XXXX
2. YYYY
3. ZZZZ
Please enter the height :
<min = 0 | max = 200>
while(((height < 0)||(height > 200))||(!(isdigit(weight))))
{
if(isdigit(height))
{
printf("\nPlease enter the height between 0 to 200 !\n");
printf("Please enter the height\n");
printf("(Min = 0 | Max = 200)\n>>");
scanf("%d",&height);
}
else
{
printf("\nPlease enter the height in digit form.\n");
printf("Please enter the height\n");
printf("(Min = 0 | Max = 200)\n>>");
scanf("%d",&height);
}
}
tomiverson 发表于 2013-3-26 04:28 PM
我找到这个,你或许可以试试看
http://www.dreamincode.net/forums/topic/53355-c-check-if-variable-is ...
tomiverson 发表于 2013-3-27 10:04 AM
让我搞清楚你要的
1. 你要只是让user key in alphabet吗? 如果有任何数字就return error?这个decl ...
K_POP 发表于 2013-3-28 05:58 PM
1. 我让user输入数字, 但是在code里面是char type...虽然user打alphabet会出error....但是user输入13 ( ...
欢迎光临 JBTALKS.CC (https://www.jbtalks.cc/) | Powered by Discuz! X2.5 |