[单选题]

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

#include <stdio.h>

#include <ctype.h>

#include <string.h>

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;

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

参考答案与解析:

相关试题

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

[单选题]阅读下列程序,当运行函数时,输入asd af aa z67,则输出为include include i阅读下列程序,当运行函数时,输入asd af aa z67,则输出为 #include <stdio.h> #include <ctype.h> #include <string.h> 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';

  • 查看答案
  • 阅读下列程序,当运行函数时,输入asd af aa z67,则输出为#inclu

    [单选题]阅读下列程序,当运行函数时,输入asd af aa z67,则输出为includeincludeine阅读下列程序,当运行函数时,输入asd af aa z67,则输出为 #include <stdio.h> #include <ctype.h> #inelude <string.h> 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'

  • 查看答案
  • 阅读下列程序,当运行函数时,输入asd af aa z67,则输出为#inclu

    [单选题]阅读下列程序,当运行函数时,输入asd af aa z67,则输出为includeincludeinc阅读下列程序,当运行函数时,输入asd af aa z67,则输出为 #include<stdio.h> #include<ctype.h> #include<string.h> 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'; }

  • 查看答案
  • 阅读下列程序,当运行程序时,输入asd af aa z67,则输出为()。#in

    [单选题]阅读下列程序,当运行程序时,输入asd af aa z67,则输出为()。includeint fun (char *str阅读下列程序,当运行程序时,输入asd af aa z67,则输出为( )。 #include <sldio.h> 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[

  • 查看答案
  • 阅读下列程序,当运行函数时,输入asdafaaz67,则输出为 #include

    [单选题]阅读下列程序,当运行函数时,输入asd af aa z67,则输出为#include#include#includeint 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(st

  • 查看答案
  • 请编写一个函数,用来删除字符串中的所有空格。 例如:输入asd af aa z6

    [试题]请编写一个函数,用来删除字符串中的所有空格。例如:输入asd af aa z67,则输出为asdafaz67。注意:部分源程序给出如下。请勿改动主函数main和其他函数中的任何内容,仅在函数fun的花括号中填入所编写的若干语句。试题程序:include<stdio.h>include<ctype.h>include<conio.h>int fun(char*str){}main(){char str[81];int n;clrscr();printf("Input a string:");ge

  • 查看答案
  • 在“与”逻辑门电路中,输入量A为1,输入量B为1,则输出函数Z为()。

    [填空题] 在“与”逻辑门电路中,输入量A为1,输入量B为1,则输出函数Z为()。

  • 查看答案
  • 阅读以下程序如运行时输入This is example.<CR>,则程序的输出结

    [单选题]阅读以下程序如运行时输入This is example.<CR>,则程序的输出结果是( )。A.ThisB.This isC.This iS aD.This is an example.

  • 查看答案
  • 阅读下面的程序,当输入分别为111和222时,程序输出为 ______。n1=I

    [单选题]阅读下面的程序,当输入分别为111和222时,程序输出为 ______。 n1=InputBox(”请输入第一个数:”) n2=Val(1nputBox("请输入第二个数:")) Print n1+n2A.111222B.222C.333D.程序出错

  • 查看答案
  • 运行下列程序时,若输入数据为“321”,则输出结果是()。main(){int

    [单选题]运行下列程序时,若输入数据为“321”,则输出结果是( )。 main() {int num,i,j,k,s; scanf("%d",&num); if(num>99) s=3; else if(num>9) s=2; else s=1; i=num/100; j=(num-i*100)/10; k=(num-i*100-j*10); switch(s) {case 3:printf("%d%d%d/n",k,j,i); break; case 2:printf("%d%d/n

  • 查看答案