网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

有以下程序

#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


参考答案

更多 “ 有以下程序#includestdio.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,30B.30,17C.15,30D.20,15 ” 相关考题
考题 有以下程序#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.hmain( ){ int a[ ]={1,2,3,4},y,*p=a[3];--p; y=*p; printf("y=%d\n",y);}程序的运行结果是A)y=0B)y=1C)y=2D)y=3

考题 有以下程序includemain(){inta[]={1,2,3,4},y,*p=a[3];--p;y=*p;printf("y=%d\n" 有以下程序 #include <stdio.h> main() { int a[]={1,2,3,4},y,*p=a[3]; --p; y=*p;printf("y=%d\n",y); } 程序的运行结果是A.y=0B.y=1C.y=2D.y=3

考题 有下列程序: include main() {int a[]={1,2,3,4},y,*p=a[3]; -- 有下列程序: #include <stdio.h> main() {int a[]={1,2,3,4},y,*p=a[3]; --p; y=*p; printf("y=%d\n",y); } 程序的运行结果是( )。A.y=0B.y=1C.y=2D.y=3

考题 有以下程序:includemain(){intx=1,y=0,a=0,b=0;switch(x){case 1:switch(y){case 0:a+ 有以下程序: #include<stdio.h> main() { int x=1,y=0,a=0,b=0; switch(x) { case 1: switch(y) { case 0:a++;break; case 1: b++;break; } case 2:a++;b++;break; case 3:a++;b++; } printf("a=%d,b=%d\n",a,B); } 程序的运行结果是( )。A.a=1,b=0B.a=2,b=2C.a=1,b=1D.a=2,b=1

考题 以下程序段()。intx=1,y=4;printf(x() A.输出控制格式错误B.输出:x=1C.输出:y=1D.输出:y=4

考题 有下列程序:#includestdi0.hstructst{intx,Y,date[2]={1,10,2,20};voidmain( ){structst*p=date;printf(%d,,p-y);printf(%d\n,(++p)-x);}程序的运行结果是( )。A.10,1B.20,1C.10,2D.20,2

考题 以下程序段的执行结果是()。includeVoid main() {int a, y;a=10;y=1do{a+=2;y+=a;co 以下程序段的执行结果是( )。#include<iostream.h>Void main() {int a, y; a=10;y=1 do{ a+=2; y+=a; cout<<"a" ="<<a<<","<<"y="<<y<<"\n"; if(y>20) break; }while(a<= 14);}A.a=12,y=12 a=14,y=16 a=16,y=20B.a=12,y=12 a=14,y=26C.a=12,y=12 a=14,y=26 a=14,y=44D.a=12,y=12

考题 有下列程序: #includestdi0.h structord {intx,y;}dt[2]={1,2,3,4}; voidmain( ) {structord*p=dt; printf("%d,",++P-x);printf("%d,",++P -y); } 程序的运行结果是( ).A.1,2B.2,3C.3,4D.4,1

考题 有以下程序:include main() {int a[] = {2,4,6,8,10} ,y =0,x, * p;p =a[1];for( 有以下程序: #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.10B.11C.14D.15

考题 有以下程序 include struct tt { int x; struct tt *y; } *p; s 有以下程序 #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,17C.15,30,D.20,15,

考题 有以下程序:includestruct tt{int x;struct tt*y;}*p;struct tt a[4]={20,a+1,15,a+2, 有以下程序: #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,17C.15,30D.20,15

考题 设有以下程序:Private Sub Form_ Click() x=50 For i=1 To 4 y=InputBox(“请输入—个整数”) y=Val(y) If y Mod 5=0 Then a=a+ y x=y Else a=a+ x End If Next i Print aEnd Sub 程序运行后,单击窗体,在输入对话框中依次输入15、24、35、46,输出结果为 ______。A.100B.50C.120D.70

考题 有以下程序includestruct ord{ int x,y;} dt[2]={1,2,3,4};mare(){struct ord*p=dt; p 有以下程序 #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,2B.2,3C.3,4D.4,1

考题 有以下程序: include using namespace std; voidt(intx,inty, intcp,intdp) {cp=x*x+y 有以下程序:include <iostream>using namespace std;void t(int x,int y, int cp,int dp){cp=x*x+y+y;dp=x*x-y*y;}int main(){int a=4,b=3,c=5,d=6;t(a,b,c,D) ;cout<<c<<","<<d<<end1;return 0;

考题 有下列程序: #includestdi0.h voidfun(int*a,int*b) {int*C; c=a;a=b;b=C; } voidmain( ) {intx=3,y=5,*p=&x,*q=&y; fun(p,q);printf("%d,%d,",*P,*q); fun(&x,&y);printf("%d,%d\n",*P,*q) } 程序运行后的输出结果是( )。A.3,5,5,3B.3,5,3,5C.5,3,3,5D.5,3,5,3

考题 有以下程序 include struct st { int x,y;} data[2]={1,10,2,20}; main( 有以下程序 #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,1B.20,1C.10,2D.20,2

考题 执行以下程序后,y的值是 ( ) main( ) { int a [ ]={2,4,6,8,10); int y=1,x, *p; p=a[1]; for(x=0;x<3; x + +) y + =* (p + x); printf("%d\n",y); }A.17B.18C.19D.20

考题 有以下程序:includemain(){int a[]={1,2,3,4},y,*p=--p;y=*p;printf("y=%d\n",y 有以下程序: #include<stdio.h> main() { int a[]={1,2,3,4},y,*p=&a[3]; --p;y=*p;printf("y=%d\n",y); } 程序的运行结果是( )。A.y=0B.y=1C.y=2D.y=3

考题 有以下程序: #include(iostream.h) voidfun(inta,intb,intc) {a=456,b=567,C=678;} voidmain( ) { intx=10,y=20,z=30; fun(x,Y,z); coutx,y,Zendl; } 输出结果是( )。A.30,20,10B.10,20,30C.456,567,678D.678,567,456

考题 有以下程序:includestxucttt{ intx;structtt *y;}*p;struct tta[4]={20,a+1,15,a+2,30 有以下程序: #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,17C.15,30,D.20,15,

考题 下面程序和运行运行结果是【 】。void swap(int * a,int * b){ int * t;t=a; a=b; b=t;}main( ){ intx=3,y=5,* p=&x,* q=&y;swap(p,q);prinff("%d %d\n", *p, *q);}

考题 单选题有以下程序:#include main(){ int a[]={1,2,3,4},y,*p=a[3]; --p; y=*p; printf("y=%d",y);}程序的运行结果是(  )。A y=0B y=1C y=2D y=3

考题 单选题有以下程序: #include main() {  intx=1,y=2,z=3;  if(x1)   if(yx)putchar('A');   elseputchar('B');  else   if(z A DB CC BD A

考题 单选题有以下程序: #include intm1(intx,inty) {  returnx=y?x:y; } intm2(intx,inty) {  returnx=y?y:x; } intfun(inta,intb) {  returna+b; } main() {  intx=2,y=3,z=1;  printf(%d,fun(m1(x,y),m2(y,z))); } 程序的运行结果是(  )。A 6B 5C 4D 3

考题 单选题有以下程序 #include intfun(intx,inty) {  if(x!=y)return((x+y)/2);  elsereturn(x); } main() {  inta=4,b=5,c=6;  printf(%d,fun(2*a,fun(b,c))); } 程序运行后的输出结果是(  )。A 3B 6C 8D 12

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

考题 单选题有以下程序: #include main() {  intx[3][4]={1,3,5,7,9,11,2,4,6,8,10,12};  int(*p)[4]=x,k=1,m,n=0;  for(m=0;m  printf("%d",n); } 程序的运行结果是(  )。A 10B 20C 14D 16