语法:
#include <cctype> int isdigit( int ch );
如果参数是0到9之间的数字,函数 isdigit() 返回非零。否则,返回零。
char c; scanf( "%c", &c ); if( isdigit(c) ) printf( "You entered the digit %c\n", c );
相关主题: isalnum, isalpha, iscntrl, isgraph, isprint, ispunct, isspace, isxdigit