有以下程序: #include <stdio.h> stxuct 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,
第1题:
有以下程序: #include <stdio.h> main() { int a[] = {2,4,6,8,10} ,y =0,x, * p; p =&a[1]; for(x=1;x<3;x++)y+ =p[x]; printf( "% d \n" , y); }程序运行后的输出结果是( )。
A.10
B.11
C.14
D.15
第2题:
有以下程序:
#include <stdio.h>
#include <stdlib.h>
struct NODE
{ int num;
struct NODE *next;
};
main()
{ struet NODE *p,*q,*r;
int sum=0;
p=(struct NODE *) malloc(sizeof(struct NODE));
q=(struct NODE *) malloc(sizeof(struet NODE));
r=(struct NODE *) malloc(sizeof(struct NODE));
P- >num=1;q- >num=2;r->num=3;
p- >next=q;q- >next=r;r- >next=NULL;
sum + =q- >next- >num;sum + =P- >num;
printf("%d\n",sum);
}
执行后的输出结果是( )
A.3
B.4
C.5
D.6
第3题:
有以下程序 #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
第4题:
以下程序的输出结果是【 】。
include<stdio.h>
main()
{ struct stru
{ int a;
float b;
char d[4];
};
printf("%d\n",sizeof(struct stru));
}
第5题:
有以下程序 #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
第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=l;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>
main()
{ intx=10,y=10,i;
for(i=0;x>8;y=++)
printf("%d%d",X--,y);
}
第8题:
有以下程序: #include<stdio.h> main() { int a[]={1,2,3,4},y,*p=&a[3]; --p;y=*p;printf("y=%d\n",y); } 程序的运行结果是( )。
A.y=0
B.y=1
C.y=2
D.y=3
第9题:
有以下程序:
#include<stdlib.h>
struct NODE
{ int num;stmct NODE *next;};
main( )
{ struct NODE * p, * q,* r;
p=(struct NODE * )malloc(sizeof(struct NODE) );
q=(struct NODE * )malloc(sizeof(struct NODE) );
r=(struct NODE * )malloc(sizeof(struct NODE) );
p->num=10; q->num=20; r->num=30;
p->next=q; q->next=r;
printf("%d\n",p->num+q->next->num);
}
程序运行后的输出结果是
A.10
B.20
C.30
D.40
第10题:
有以下程序
#include<stdlib.h>
struct NODE
{int num;struct NODE*next;}
main()
{struct NODE *P,*q,*r;
p=(struct NODE *)malloc(sizeof(struct NODE));
q=(struct NODE *)malloc(sizeof(struet NODE));
r=(struct NODE*)malloc(sizeof(struct NODE)):
p->num=10;q->num=20;r->num=30;
p->next=q;q->next=r;
printf("%d\n",p->num+q->next->num):
}
程序运行后的输出结果是( )
A.10
B.20
C.30
D.40
第11题:
有以下程序
#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
第12题:
10,1
20,1
10,2
20,2
第13题:
有以下程序 #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,
第14题:
有以下程序: #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
第15题:
有以下程序: #include <stdio.h> main( ) { struct node{int n; struct node*next;} *P; struct node x[3]={{2,x+1),{4,x+2},{6,NULL}}; P= X; printf("%d,",p->n); printf("%d\n",p->next->n); } 程序运行后的输出结果是( )。
A.2,3
B.2,4
C.3,4
D.4, 6
第16题:
有以下程序
#include<stdlib.h>
struct NODE
{ int num;stmct NODE*next;};
main()
{ struct NODE*p,*q,*r;
p=(struct NODE*)malloc(sizeof(struct NODE));
q=(struct NODE*)malloc(sizeof(struct NODE));
r=(struct NODE*)malloc(sizeof(struct NODE));
p->num=10;q->num=20;r->num=30;
p->next=q;q->next=r;
printf(“%d\n”,p->num+q->next->num);
}
程序运行后的输出结果是
A.10
B.20
C.30
D.40
第17题:
有以下程序 #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=l;i<=2;i++){printf("%d,",p->x);P =p->y;} } 程序的运行结果是( )。
A.20,30,
B.30,17,
C.15,30,
D.20,15,
第18题:
有以下程序: #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,
第19题:
有以下程序:
#include <stdlib.h>
struct NODE
{ int num; struct NODE *next; };
main()
{ struct NODE *p,*q,*r;
p=(struct NODE*)malloc(sizeof(struct NODE));
q=(struct NODE*)mallloc(sizeof(struct NODE));
r=(struct NODE*)malloc(sizeof(struct NODE));
p->num=10;q->num=20; r->num=30;
p->next=q;q->next=r;
printf("%d\n",p->num+q->next->num);
}
程序运行后的输出结果是( )。
A.10
B.20
C.30
D.40
第20题:
以下程序的输出结果是 #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
第21题:
以下程序的输出结果是( )。 #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
第22题:
有以下程序: #include <stdio.h> #define F(X,Y)(X)*(Y) main() { int a=3,b=4; printf("%d\n",F(a++,b++)); } 程序运行后的输出结果是( )。
A.12
B.15
C.16
D.20
第23题:
20,15,
30,17,
15,30,
20,30,