更多"[单选题]以下程序的输出结果是()。
struct H"的相关试题:
[单选题]以下程序的输出结果是()。
struct HAR
{ int x, y; struct HAR *p;} h[2];
main()
{h[0].x=1;h[0].y=2;
h[1].x=3;h[1].y=4;
h[0].p=&h[1];h[1].p=h;
printf("%d %d \n",(h[0].p)->x,(h[1].p)->y);}
A.1 2
B.2 3
C.1 4
D.3 2
[单选题]以下程序的输出结果是()。
union myun
{ struct
{ int x, y, z; } u;
int k;
} a;
main()
{ a.u.x=4; a.u.y=5; a.u.z=6;
a.k=0;
printf("%d\n",a.u.x);}
A.4
B.5
C.6
D.0
[单选题]下列程序的输出结果是()。
struct abc
{ int a, b, c; };
main()
{ struct abc s[2]={{1,2,3},{4,5,6}}; int t;
t=s[0].a+s[1].b;
printf("%d \n",t);
}
A.5
B.6
C.7
D.8
[单选题]以下程序输出结果是()。
main()
{ int m=5;
if(m++>5) printf("%d\n",m);
esle printf("%d\n",m- -);
}
A.7
B.6
C.5
D.4
[单选题]以下程序的输出结果是()。
long fun( int n)
{ long s;
if(n==1||n==2)s=2;
else s=n-fun(n-1);
return s;}
main()
{ printf("%ld\n", fun(3)); }
A.1
B.2
C.3
D.4