以下程序的输出结果是 #include<stdio.h> struct st { int x;int *y;}*p; int dt[4]={10,20,30,40}; struct st aa[4]={50,&dt[0],60,&dt[0],60,&dt[0],60,&dt[0],}; main() { p=aa; printf("%d\n",++(p->x));}
A.10
B.11
C.51
D.60
第1题:
下列程序的输出结果是( )。
#include<stdio.h>
VOid p(int *x)
{ printf("%d",++*x);
}
void main()
{ int y=3;
p(&y);
}
A.3
B.4
C.2
D.5
第2题:
若有以下程序段: #include <iostream> using namespace std; int main () { int a[]={1,4,5}; int *p=&a[0],x=6, y,z; for (y=0; y<3; y++) z= ( (* (p+y) <x) ? *(p+y) :x); cout<<z<<end1; return 0; } 程序运行后的输出结果是( )。
A.1
B.4
C.5
D.2
第3题:
以下程序的输出是( )。 struct st { int x;int *y; } *p; int dt[4]={10,20,30,40}; struct st aa[4]= {50,&dt[0],60,&dt[1],70,&dt[2],80,&dt[3]}; main() { p=aa; cout<<++p->x; cout<<(++p)->x; cout<<++(*p->y); }
A.10 20 20
B.50 60 21
C.51 60 21
D.60 70 31
第4题:
下列程序的输出结果是( )。 #include<stdio.h> main() { struct st { int y,x,z; }; union { long i; int j; char k; }un; printf("%d,%d\n",sizeof(struct st),sizeof(un)); }
A.6,2
B.6,4
C.8,4
D.8,6
第5题:
以下程序的输出结果是( )。 {int x;int*y;}*p; int dt[4]={1,2,3,4}; struct st aa[4]={2,&dt[0],3,&dt[0],4,&dt[0],5,&dt[0],}; {p=aa; pfintf("%d\n",++(p->x)); }
A.1
B.2
C.3
D.4
第6题:
有以下程序: #include<stdio.h> struct tt {int x;struct tt*y;}*p; struct tt a[4]={20,a+1,15,a+2,30,a+3,17,a} main() { int i; p=a; for(i=1;i<=2;i++){printf("%d",p->x);p=P->y;} } 程序的运行结果是( )。
A.20,30,
B.30,17
C.15,30
D.20,15
第7题:
有以下程序 #include <stdio.h> struct st { int x,y;} data[2]={1,10,2,20}; main() { struct st *p=data; printf("%d,",p->y); printf("%d\n",(++p)->x); } 程序的运行结果是______。
A.10,1
B.20,1
C.10,2
D.20,2
第8题:
以下程序输出结果是 ______。 #include<iostream.h> void fun(int x,int y,int z){z=x+y;} void main() { int a=10; fun (2,2,a); cout<<a; }
A.0
B.4
C.10
D.无定值
第9题:
以下程序执行后输出的结果是【 】。
include<iostream>
using namespace std;
int fac(int a,int b){
return(b-a)*a;
}
int main(){
int x=3,y=4,z=5,result;
result=fac(fac(x,y),fac(x,z));
cout<<result<<endl;
return 0;
}
第10题:
以下程序的输出是( )。 struct st { int x;int *y; } *p; int dt[4]={10,20,30,40}; struct st aa[4]={50,&dt[0],60,&dt[0],60,&dt[0],60,&dt[0],}; main() { p=aa; cout<+<+(p->x); }
A.10
B.11
C.51
D.60
第11题:
以下程序的输出结果是( )。 #include<stdio.h> struct st { int x; int *y;} *p; int dt[4] ={ 10,20,30,40 }; struct st aa[4]={ 50,&dt[0],60,&dt[0],60,&dt[0],60,&dt[0]}; main() { p=aa; printf("%d\n",++(p->x)); }
A.10
B.11
C.51
D.60
第12题:
(37)有以下程序
#include <stdio.h>
struct ord
{ int x,y;}dt[2]={1,2,3,4};
main()
{
struct ord *p=dt;
printf("%d,",++(p->x)); printf("%d\n",++(p->y));
}
程序运行后的输出结果是
A)1,2
B)4,1
C)3,4
D)2,3
第13题:
下列程序的输出结果是( )。
#include<stdio.h>
voidp(int*x)
{printf("%d",++*x);
}
voidmain()
{int y=3;
p(&y);
}
A.3
B.4
C.2
D.5
第14题:
下列程序的输出结果是( )。 #include<stdio.h> void p(int *x) { printf("%d",++*x); } void main() { int y=3; p(&y); }
A.3
B.4
C.2
D.5
第15题:
以下程序的输出是______。 struct st {int x;int*y; }*p; int dt[4]={10,20,30,40}; struct st aa[4]={50,&dt[0],60,&dt[1],60,&dt[2],60,&dt[3]}; main() { p=aa; printf("%d\n",++(p->X)); }
A.51
B.11
C.50
D.60
第16题:
有以下程序 #include <stdio.h> struct tt { int x; struct tt *y; } *p; struct tt a[4]= {20,a+ 1,15,a+2,30,a+3,17,a}; main() { int i; p=a; for(i=1; i<-2; i++) { printf("%d,", p->x ); p=p->y; }
A.20,30,
B.30,17
C.15,30,
D.20,15,
第17题:
下列程序的输出结果是( )。 #include <stdio.h> main() { struct st { int y,x,z; }; union { long i; int j; char k; } un; printf("%d,%d\n",sizeof(struct st),sizeof(un)); }
A.6, 2
B.6, 4
C.8, 4
D.8, 6
第18题:
有以下程序 #include<stdio.h> struct ord { int x,y;} dt[2]={1,2,3,4}; mare() { struct ord*p=dt; printf("%d,",++p->x); printf("%d\n",++p->y); } 程序的运行结果是______。
A.1,2
B.2,3
C.3,4
D.4,1
第19题:
下列程序的输出结果是______。struct st{ int x;int*y;}*p; int dt[4]={ 10,20,30,40 }; struct st aa[4]={50,&dt[0],60,&dt[0],60,&dr[0],60,&dr[0],} main(){ p=aa; printf("%d\n",++(p->x));}
A.51
B.11
C.10
D.60
第20题:
有以下程序
#include<stdio.h>
struct ord
{int x,y;} dt[2]={1,2,3,4};
main()
{
struct ord*p=dt;
printf(“%d,”,++(p一>x));printf(“%d\n”,++(p一>y));
}
程序运行后的输出结果是
A.1,2
B.4,1
C.3,4
D.2.3
第21题:
有以下程序: #include<stdio.h> struct ord {int X,y;)dt[2]={1,2,3,4}; main( ) { struct ord*p=dt; printf("%d,",++(p->x));printf("%d\n",++(p->y)); } 程序运行后的输出结果是( )。
A.1,2
B.4,1
C.3,4
D.2,3
第22题:
以下程序的输出结果是______。#include<stdio.h>struct stu{ int num; char name[10]; int age;};void fun(struct stu*p){ printf("%s\n",(*p).name);}main(){ struct stu students[3]={ {9801,"Zhang",20}, { 9802,"Wang",19}, { 9803,"Zhao",18} }; fun(students+2);}
A.Zhang
B.Zhao
C.Wang
D.18
第23题:
以下程序的输出结果是 ( ) struct st { int x; int * y;} * p; int dt[4]={10,20,30,40}; struct st aa[4]={50,&dt[0],60,& dt[0],60 &dt[0],60,&dt [0]}; main( ) { p=aa; printf("%d\n",+ +(p->x)); }
A.10
B.11
C.51
D.60