A: 2,3
B: 1,2
C: 3,1
D: 2,1
举一反三
- 有以下程序#include <;stdio.h>;struct tt{int x;struct tt *y;}s[3]={1,0,2,0,3,0};main(){struct tt *p=s+1;p->;y=s;p=p->;y;printf("%d\n",p->;x);}程序运行后的输出结果是 A: 2,3 B: 2,1 C: 1,2 D: 3,1
- 以下程序的输出结果是( )。 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); }
- #include struct ord{ int x,y;} dt[2]={1,2,3,4};int main(){ struct ord *p=dt; printf("%d,",++p->x); printf("%d\n",++p->y); return 0;} A: 2,3 B: 1,2 C: 3,4 D: 4,1
- 第38题(本题:1分) 有以下程序[br][/br]#include [stdio.h][br][/br]struct tt[br][/br]{ int x; struct tt *y; } s[3]={ 1,0,2,0,3,0};[br][/br]main( )[br][/br]{ struct tt *p=s+1;[br][/br]p->y=s;[br][/br]printf("%d,",p->x); [br][/br]p=p->y;[br][/br]printf("%d\n",p->x); [br][/br]} [br][/br]程序运行后的输出结果是 A: 2,3 B: 2,1 C: 1,2 D: 3,1
- 10.以下程序的输出结果是( )。 #include struct HAR { int x,y; struct HAR *p; }h[2]; int 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); return 0; } A: 1 2 B: 2 3 C: 1 4 D: 3 2
内容
- 0
有以下程序#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 ",++(p->y));}程序运行后的输出结果是( ) A: 3,4 B: 4,1 C: 2,3 D: 1,2
- 1
有程序如下定义,输出结果为____ ____ ____ 。#include <stdio.h>struct info{ int x,float y;char z} st={10,10.0,’a’};main(){ struct st *pa=&st;printf(“%d ”,s.x);printf(“%c “,p->z);printf(“%.2f “,(*p)->y);}
- 2
下程序的运行结果是:____,____,____。struct atype{ int m;char *pn;}tab[2]={{1,"ab"},{2,"cd"}},*p=tab;void main(){ printf("%d",tab[1].m);printf("%c",*p->pn);printf("%c",*(++p)->pn);}
- 3
以下程序的输出结果是 main() {int a[]={2,4,6,8,10},y=1,x,*p; p=&a[1]; for(x=0;x<3;x++) y+=*(p+x); printf("%d\n",y); }
- 4
以下程序的输出结果是( )。#include <;stdio.h>;struct HRA{int x,y;struct HRA *p;}h[2];int main(){h[0].x=1; h[0].y=2; h[0].p=&h[1];h[1].x=3; h[1].y=4; h[1].p=h;printf(“%d,%d”, (h[0].p)->;x,(h[1].p)->;y);return 0;} A: 1,2 B: 3,2 C: 2,3 D: 1,4