标签:
模拟实现源码:
int isdigit(int c) { return ('0' <= c && c <= '9'); }
#include <ctype.h> #include <stdio.h> main() { char str[]="acd345&^%$89[e?"; int i = 0; for(i=0;str[i]!=0;i++) { if(isdigit(str[i])) { printf("%c 是阿拉伯数字\n",str[i]); } else { printf("%c 不是阿拉伯数字\n",str[i]); } } }运行结果:
标签:
原文地址:http://blog.csdn.net/kongshuai19900505/article/details/51549632