'X''Y''Z''W''V'
VWXYZ
ZYXWV
'ABCDE'
第1题:
有以下程序: #include <stdio. h> main ( ) { inti=0.s=0; for(;;) if( i = = 3 ‖ i = = 5 ) continue; if (i ==6) break; i++; s+ =i; } printf(" % d \n" ,s);程序运行后的输出结果是( )。
A.10
B.13
C.21
D.程序进入列循环
第2题:
有以下程序: #include <stdio.h> void f(int v, int w) { int t; t=v; v=w; w=t; } main() { int x=1,y=3,z=2; if(x>y) f(x,y); else if(y>z) f(y,z); else f(x,z); printf("%d,%d,%d\n",x,y,z); } 执行后的输出结果( )。
A.1,2,3
B.3,1,2
C.1,3,2
D.2,3,1
第3题:
以下程序运行后的输出结果是【 】。
include<iostream.h>
void main()
{
char a[]="abcdabcabfgacd";
int i 1=0,i2=0,i=0;
while (a[i])
{
if (a[i]=='a')
il++;
if (a[i]=='b')
i2++;
i++;
}
cout<<il<<' '<<i2<<endl;
}
第4题:
以下程序运行后输入:3,abcde<回车>,则输出结果是【 】
include <string.h>
move(char *str, int n)
{ char temp; int i;
temp=str[n-1];
for(i=n-1;i>0;i--) str[i]=str[i-1];
str[0]=temp;
}
main( )
{ char s[50]; int n, i, z;
scanf("%d,%s",&n,s);
z=strlen(s);
for(i=1; i<=n; i++) move(s, z);
printf("%s\n",s);
}
第5题:
下面程序的运行结果是( )。 include<stdio.h> main() {char a[80],*p="AbabCDcd"; int i=0,j=0; while(*(p++)!='\0') {if(*p>='a'&&*p<='z'){a[i]=*p;i++;} } a[i]='\0'; puts(A); }
第6题:
下面程序的结果【 】。
include<iostream.h>
int f(int);
void main() {
int x=1, i;
for (i=0; i<3; i++)
cout<<f(x)<<‘ ’ ;
cout<<end1;
}
int f(int x){
int y=1;
static int z=3
y++;
z++;
return (x+y+z);
}
第7题:
下列程序的输出结果是( )。
#include<stdio.h>
main()
{ stmct st
{ int y,x,z;
};
union
{ long i;
int j;
char k;
}un;
printf("%d,%d\n",sizeof(stmct st),sizeof(un));
}
A.6,2
B.6,4
C.8,4
D.8,6
第8题:
以下程序运行后的输出结果是【 】
include <stdio.h>
main ( )
{ char a[] ="123456789", *p;
int i =0;
p=a;
while( * p)
{ if(i%2 ==0) *p='*';
p++;i++;
}
puts(a);
}
第9题:
有以下程序: #include <stdio.h> main ( ) { int a[3] [3] , *p,i; p=&a[0][0]; for(i=0;i<9; i++)p[i]=i: for(i=0; i<3;i++)Printf("%d",a[1][i]); } 程序运行后的输出结果是( )。
A.012
B.123
C.234
D.345
第10题:
以下程序运行后的输出结果是( )。 include<string.h> main() {char ch[]="abcd",x[4][4];int i; for(i=0;i<4;i++)strcpy(x[i],ch); for(i=0;i<4;i++)printf("%s",&x[i][i]); printf("\n"); }