填空题

以下程序的功能是将宁符串s中的数字字符放入d数组中,最后输出d中的字符串。例如,输入字符串:abcl23edf4568h,执行程序后输出:123456。请填空。 #include <stdio.h> #include <ctype.h> main() { char s[80],d[80]; int i,j; gets(s); for(i=j=0;s[i]!=’\0’;i++) if( 【20】 ) {d[j]=s[i];j++;} d[j]=’\0’; puts(d); }

【参考答案】

s[i]>=’0’&& s[i]<=’9’ 或 isdigit(s[i]) 或 s[i]>=48&&s[i]<=57或s......

(↓↓↓ 点击下方‘点击查看答案’看完整答案、解析 ↓↓↓)