单选题 C语言
题号 #2546612

下面程序的运行结果是(  )。
#include<stdio.h>
void del(char*s)
{int i,j;
char*a:
a=s:
for(i=0,j一0;a[i]!='\o' ; i++)
{if(a[i]>='0'&&a[i]<='9')
{  s[j]=a[i];
j++;
}
s[j]='\0' ;
}
)
main()
{  char*s==”aa89gggh”:
del(s);
printf(”\n%s”,s);

进入在线模考

参考答案

B

答案解析

B。【解析】本题中del(char*s)函数实现的功能是逐个读入S数组中的字符,如果遇到数字,则将数字存在S中,遇到非数字字符则跳过。所以最后输出的应该是字符串s中所有数字的个数。

你可能感兴趣的试题

找试题 · 找答案 · 找资料 在线模考