• 2022-06-12
    有以下程序 #include struct tt {int x;struct tt *y;} s[3]={1,0,2,0,3,0}; main() { struct tt *p=s+1; p->y=s; printf("%d,",p->x); p=p->y; printf("%d\n",p->x); } 程序运行后的输出结果是______。
    A: 2,3
    B: 1,2
    C: 3,1
    D: 2,1
  • D

    内容

    • 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&#91;2&#93;;int main(){h&#91;0&#93;.x=1; h&#91;0&#93;.y=2; h&#91;0&#93;.p=&amp;h&#91;1&#93;;h&#91;1&#93;.x=3; h&#91;1&#93;.y=4; h&#91;1&#93;.p=h;printf(“%d,%d”, (h&#91;0&#93;.p)->;x,(h&#91;1&#93;.p)->;y);return 0;} A: 1,2 B: 3,2 C: 2,3 D: 1,4