有以下程序#include stdio.hstruct 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,17C)15,30,D)20,15,

有以下程序

#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,


相关考题:

设有以下语句typedef struct TT{char c,int a[4];} CIN;则下面叙述中正确的是A) 可以用 TT 定义结构体变量B)TT 是 struct 类型的变量C) 可以用 CIN 定义结构体变量D)CIN 是 struct TT 类型的变量

下列语句段中,正确的是( )。A.struct{int x;float y;int a[2];unsigned b[3];char name[10];};B.struct stu{unsigned a[3];unsigned b[4];}x;int*p=x.a;C.struct stu{int a;float x[4];}y={1,1.0};float data=y.x;D.struct nd{int a,b;unsigned c[2]=5;};

设有以下语句 typedef struct TT {char c; int a[4];}CIN; 则下面叙述中正确的是______。A.可以用TT定义结构体变量B.TT是struct类型的变量C.可以用CIN定义结构体变量D.CIN是struct TT类型的变量

以下程序调用函数swap将指针s和t所指单元(a和B)中的内容交换,请填空。 main() {int a=10,b=20,*s,*t; s=a;t=b; ( ) printf("%d%d",a,B); } swap(int*ss,int*tt) {int te; te=*ss; *ss=*tt; *tt=te; }

下列给定程序中,函数fun()的作用是:将字符串tt中的小写字母都改为对应的大写字母,其他字符不变。例如,若输入“edS,dAd”,则输出“EDS,DAD”。请改正程序中的错误,使它能得到正确结果。注意:不要改动main函数,不得增行或删行,也不得更改程序的结构。试题程序:include <stdio.h>include <string.h>include <conlo.h>/*************found*************/char fun(char tt[ ]){int i;for(i=0;tt[i];i++){/*************found*************/if((tt[i]>='A')(tt[i]<='2'))tt[i]-=32;}return(tt);}main(){int i;char tt[81];clrscr();printf("\nPlease enter a string:");gets(tt);printf("\nThe result string iS:/n%s", fun(tt));}

设有以下语句:typedef struct TY{char C;int a{4 1;}CIN;则下面叙述中正确的是( )。A.CIN是struct Tr类型的变量B.TT是struct类型的变量C.可以用,lr定义结构体变量D.可以用CIN定义结构体变量

下列语句段中,正确的是( )。A.struct {int x; float y; int a[2]; unsigned b[3]; char name[10]; };B.structstu { unsigneda[3]; unsigned b[4]; }x; int*p=x.a;C.struc tsu { int a; float x[4]; }y={1,1.0}; floatdat a=y.x;D.stmct nd {int a,b; unsigned c[2]=5; };

设有以下语句: typedef struct TT {char c; int a[4];}CIN; 则下面叙述中正确的是( )。A.可以用TT定义结构体变量B.TT是struct类型的变量C.可以用CIN定义结构体变量D.CIN是struct TT类型的变量

下列语句段中,正确的是( )。A.struct { int x; float y; int a[2]; unsigned b[3]; char name[ 10]; };B.struct stu { unsigned a[3]; unsigned b[4]; }x; int *p= x.a;C.street stu { int a; float x[4]; }y={1,1.0}; float data=y.x;D.struct nd {int a,b; unsigned c[2]=5; };

对于以下的变量定义,表达式______是不正确的。 struct { float x, y; } point, *p=point;A.p->x=2.0B.(*p).y=3.0C.point.x=2.0D.*p->y=3.0