for(i = 0; str[i] = '\0'; i++) if(str[i] >= '0' && str[i]

来源:学生作业帮助网 编辑:六六作业网 时间:2024/08/29 23:17:35
for(i=0;str[i]=''\0'';i++)if(str[i]>=''0''&&str[i]for(i=0;str[i]=''\0'';i++)if(str[i]>=''0''&&str[i]for(i=0;

for(i = 0; str[i] = '\0'; i++) if(str[i] >= '0' && str[i]
for(i = 0; str[i] = '\0'; i++) if(str[i] >= '0' && str[i]

for(i = 0; str[i] = '\0'; i++) if(str[i] >= '0' && str[i]
意思就是数组元素的ASCII码比0的ASCII码大,比5的ASCII码小.
因为str[]中的元素为char.无法直接与整形比较.