单项选择题

下列程序的运行结果为( )。
#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[]="abcdef";
abc(str);
printf("str[]=%s",str);

A.str[]=bcdef
B.str[]=abcdef
C.str[]=a
D.str[]=ab
<上一题 目录 下一题>
热门 试题

单项选择题
下列程序的输出结果是( )。 #include<stdio.h> main() int a=2,b=3,p; p=f(a,b); printf( %d ,p); int f(a,b) int c; if(a>b)c=1; else if(a==b)c=0; else c=-1; return(c);
A.-1
B.0
C.1
D.2
单项选择题
下列程序中函数son()的功能是对数组a中的数据进行由大到小的排序。 #include<stdio.h> void sort(int a[],int n) int i,j,t; for(i=0;i<n-1;i++) for(j=i+1;j<n;j++) if(a[i]<a[j]) t=a[i];a[i]=a[j];a[j]=t; main() int a[10]=1,2,3,4,5,6,7,8,9,10,i; sort(&a[1],7); for(i=0;i<10;i++)printf( %d, ,a[i]); 程序运行后的输出结果是( )。
A.1,2,3,4,5,6,7,8,9,10,
B.10,9,8,7,6,5,4,3,2,1,
C.1,8,7,6,5,4,3,2,9,10,
D.1,2,10,9,8,7,6,5,4,3,
相关试题
  • 下列程序中的数组a包括10个整数元素,分...
  • 语句“int(*ptr)();”的含义是___...
  • 下列程序段的运行结果是______。 ch...
  • 下列程序的输出结果是______。 #in...
  • ’ 13’在内存中占1个字节, 12 在...