问题详情

答题翼 > 问答 > 计算机类考试 > 正文
目录: 标题| 题干| 答案| 搜索| 相关

阅读下列程序,当运行函数时,输入asdafaaz67,则输出为 #include #include #include intf


阅读下列程序,当运行函数时,输入asd af aa z67,则输出为

#include

#include

#include

int fun (char *str)

{ int i,j=0;

for(i=0;str[i]!=′\0′;i++)

if(str[i]!=′ ′)str[j++]=str[i];

str[j]= ′\0′;

}

main()

{

char str[81];

int n;

clrscr();

printf("Input a string : ");

gets(str);

puts(str);

fun(str);

printf("%s\n",str);

}

A.asdafaaz67

B.asd af aa z67

C.asd

D.z67

请帮忙给出正确答案和分析,谢谢!

参考答案
您可能感兴趣的试题