[单选题]

下列程序的运行结果为()。 include voidabc(Char*str) {inta,b,i,j; for(i=j=0;str[i]!

下列程序的运行结果为( )。

#include<stdio.h>

voidabc(Char*str)

{ inta,b,i,j;

for(i=j=0;str[i]!='/0';i++)

if(str[i]!='a')

str[j++]=str[i];

str[j]='/0';

}

void main()

{ char str[]="abcdef";

abc(str);

printf("str[]=%s",str);

}

A.str[]=bcdef

B.str[]=abcdef

C.str[]=a

D.str[]=ab

参考答案与解析:

相关试题

下列程序的运行结果为()。 #include voidabc(char*str)

[单选题]下列程序的运行结果为()。 include voidabc(char*str) {int a,b,i,j; for(i=j=0;str[i]下列程序的运行结果为( )。#include<stdio.h>voidabc(char*str){int a,b,i,j;for(i=j=0;str[i]!='/0';i++)if(str[i]!='a')str[j++]=str[j];str[j]='/0';}void main(){char Str[]="abcdef';abc(str)

  • 查看答案
  • 下列程序的运行结果为()。#includevoidabc(char*str){i

    [单选题]下列程序的运行结果为()。includevoidabc(char*str){int a,b,i,j;for(i=j=0;str[i]!='/下列程序的运行结果为( )。#include<stdio.h>voidabc(char*str){int a,b,i,j;for(i=j=0;str[i]!='/0';i++)if(str[i]!='a')str[j++]=str[j];str[j]='/0';}void main(){char Str[]="abcdef';abc(str

  • 查看答案
  • 下列程序的运行结果为#includevoid abc(char * str){

    [单选题]下列程序的运行结果为includevoid abc(char * str){ int a,b;for(a=b=0;str[a]!='/0';下列程序的运行结果为 #include<stdio.h> void abc(char * str) { int a,b; for(a=b=0;str[a]!='/0';a++) if(str[a]!='c') str[b++]=str[a]; str[b]='/0';} void main() { char str[]="abcdef";

  • 查看答案
  • 下列程序的运行结果为()。#includevoid abc(char*str){

    [单选题]下列程序的运行结果为()。includevoid abc(char*str){int a,b,i,j; for(i=j=0;str[i]!=下列程序的运行结果为( )。 #include<stdio.h> void abc(char*str) { int a,b,i,j; for(i=j=0;str[i]!='/0';i++) if(str[i]!='a') str[j++]=str[i]; str[j]='/0'; } void main() { char str[]="abcd

  • 查看答案
  • 下列程序的运行结果为#includevoid abc(char*str){int

    [单选题]下列程序的运行结果为includevoid abc(char*str){int a,b;for(a=b=0;str[a]!='/0';a£«£«下列程序的运行结果为 #include<stdio.h> void abc(char*str) { int a,b; for(a=b=0;str[a]!='/0';a++) if(str[a]!='c') str[b++]=str[a]; str[b]='/0';} void main() { char str[]="abcdef";

  • 查看答案
  • 下列程序的运行结果为#includevold abc(char*str){int

    [单选题]下列程序的运行结果为includevold abc(char*str){int a,b; for(a=b=0;str[a]!='/0';a£«下列程序的运行结果为 #include<stdio.h> vold abc(char*str) { int a,b; for(a=b=0;str[a]! ='/0';a++) if(str[a]!='c') str[b++]=str[a]; str[b]='/0';} void main() { char str[]="abcdef";

  • 查看答案
  • 下面程序的运行结果为 #include void main( ) {char a

    [单选题]下面程序的运行结果为 include void main( ) {char a='3'; switch(a) { case'3':下面程序的运行结果为#include<iostream.h>void main( ){char a='3';switch(a){case'3':cout < <"3";case'2':cout < < "2";break;default:cout < <"1";}}A.3B.321C.31D.32

  • 查看答案
  • 以下程序:#include#includemain(){char str[]="

    [单选题]以下程序:includeincludemain(){char str[]="abcd/n/123/xab";printf("%d"以下程序: #include<stdio.h> #include<string.h> main() {char str[]="abcd/n/123/xab"; printf("%d",(str)); } 运行后的输出结果是( )。A.10B.9C.7D.14

  • 查看答案
  • 下列程序的运行结果是()。#include#includemain(){char

    [单选题]下列程序的运行结果是()。includeincludemain(){char*s1="abDuj"; char*s2=下列程序的运行结果是( )。 #include<stdio.h> #include<string.h> main() { char*s1="abDuj"; char*s2="ABdUG"; int t; t=strcmp(s1,s2); printf("%d",t); }A.正数B.负数C.零D.不确定的值

  • 查看答案
  • 下列程序的输出结果为 #include voidmain() { char,a[

    [单选题]下列程序的输出结果为#includevoid main(){char,a[]={”hello",”the",”world”};char**pa=a:pa++;cout<<*pa<}A.helloB.theC.worldD.hellotheworld

  • 查看答案
  • 下列程序的运行结果为()。 #include voidabc(Char*str)