ISDIGIT的使用
#include <stdio.h>
#include <ctype.h>
main(){
char n;
scanf( "%d ",&n);
if(isdigit(n))
printf( "is digit\n ");
else
printf( "is not digit\n ");
}
不管输入数字或字母,都提示为 is not digit...?????字母解决啊
[解决办法]
n = getchar()