单选题执行以下程序后,y的值是() main( ) { int a[]={2,4,6,8,10}; int y=1,x,*p; p=a[1]; for(x=0;x3;x++) y + = * (p + x); printf(""%d/n"",y); }A17B18C19D20

单选题
执行以下程序后,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

17

B

18

C

19

D

20


参考解析

解析: 暂无解析

相关考题:

int y=1, x, *p, a[ ]={2,4,6,8,10}; p=a[1]; for(x=0;x3;x++) y + = * (p + x); printf("%d\n",y); 程序的输出结果y的值是__________ 。

有以下程序: 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

有如下程序:includevoid fun(intx, int y){int t=x; x=y; y=t;}int main(){int 有如下程序: #include<iostream> void fun(intx, int y){int t=x; x=y; y=t;} int main() { int a[2]={23,42}; fun(a[1],a[0]); std::cout<<a[0]<<","<<a[1]<<std::end1; return 0; } 执行后的输出结果是( )。A.42,42B.23,23C.23,42D.42,23

若有以下程序: include using namespace std; int f(int x, int y) {return(y-x)*x; 若有以下程序:include <iostream>using namespace std;int f(int x, int y){return (y-x)*x;}int main(){int a=3,b=4,c=5,d;d=f(f(a,b) ,f(a,c) );cout<<d<<<end1;return 0;}执行后的输出结果是【 】。

若有以下程序段:include using namespace std;int main (){ int a[]={1,4,5}; int *p 若有以下程序段: #include <iostream> using namespace std; int main () { int a[]={1,4,5}; int *p=a[0],x=6, y,z; for (y=0; y<3; y++) z= ( (* (p+y) <x) ? *(p+y) :x); cout<<z<<end1; return 0; } 程序运行后的输出结果是( )。A.1B.4C.5D.2

有如下程序:include void fun (int x,int y){int t=x;x=y;y=t;}int main(){ int 有如下程序: #include <iostream> void fun (int x,int y){int t=x;x=y;y=t;} int main() { int a[2]={23,42}; fun (a[1],a[0]; std::cout<<a[0]<<”,”<<a[1]<<std:: ond1; retum0; }执行后的输出结果是______ 。A.41,41B.23,23C.13,42D.42,23

以下程序执行后的输出结果是( )。include usingnamespacestd;void try(int,int,int,in 以下程序执行后的输出结果是( )。 #include <iostream> using namespace std; void try(int,int,int,int); int main ( ) { int x,y,z,r; x=1; y=2; try(x,y,z,r); cout<<r<<end1; return 0; } void try(int x,int y, int z,int r) { z = x+y; x = X*X; y = y*y; r = z+x+y; }A.18B.9C.10D.不确定

有以下程序void f( int y, int *x){ y=y+*x; *X=*X+y; }main(){ int x=2,y=4;f(y,x);printf("%d %d\n",x,y);}执行后输出结果是______。

分析以下程序执行结果【】。 include int f (int x, int y){return x,y; } double f (d 分析以下程序执行结果【 】。include<iostream.h>int f (int x, int y){return x,y;}double f (double x, double y) {return x,y;}void main() {int a=4, b=6;double c=2.6, d=7.4;cout<<f (a, b) <<","<<f (c, d) <<end1;}

有以下程序: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 using namespace std; class Point' { public: void SetPoint( 有以下程序: #include <iostream> using namespace std; class Point' { public: void SetPoint(int x,int y); void Move(int xOff,int yOff); int GetX() { return X; } int GetY() { return Y; } private: int X,Y; }; void Point::SetPoint(int x, int y) { X=x; Y=y; } void Point: :Move(int xOff, int yOff) X+=xOff; Y+=yOff; } int main () { Point p1; p1.SetPoint(1,2); p1.Move (5, 6); cout<<"Point1 is ("<<p1.GetX()<<','<<p1.GetY()<<")"<<end1; return 0; } 执行后的输出结果是( )。A.Point1 is (6,8)B.Point1 is (1,2)C.Point1 is (5,6)D.Point1 is (4,4)

有如下程序:include void fun(int x, int y){int t=x;x=y;y=t;}int main (){int 有如下程序: #include <iostream> void fun(int x, int y){int t=x;x=y;y=t;} int main () { int a[2]={23,42}; fun(a[1],a[0]); std::cout<<a[0]<<","<<a[1]<<std::endl; return 0; } 执行后的输出结果是A.42,42B.23,23C.23,42D.42,23

请将以下程序中的函数声明语补充完整。 include int【】 main(){int x,y,(*p)(); sccanf(" 请将以下程序中的函数声明语补充完整。include<stdio.h>int【 】main(){ int x,y,(*p)();sccanf("%d%d",x,y);p=max;printf(%d\n",(*p)(x,y));}int max(int a,int b){return(a>b?a:b);}

以下程序的执行后,x和y的值是 ______ 。 include class Sample { public: int x; 以下程序的执行后,x和y的值是 ______ 。 #include <iostream. h> class Sample { public: int x; int y; void disp() { cout<<"x="<<x<<", y="<<y<<end1; } }; void main() int Sample: :*pc; Sample s; pc=Sample:: x; s. *pc=10; pc=Sample: :y; s. *pc=.20; s. disp ();A.x=10, y=20B.x=20, y=10C.x=10, y=10D.x=20, y=20

有以下程序*f(int * x,int * y) { if( * x< * y) return x; else return y; } main() { int a=7.b=8, * p, * q, * r; p=a; q=b: r=f(p,q); coat<< * p<<","<< * q<<","<< * r<<end1; } 执行后输出结果是A.7,8,8B.7.8,7C.8,7,7D.8.7,8

以下程序执行后x的值是()。includemain(){int x,y=252,i=386,*m=y,*z=i;x=(z 以下程序执行后x的值是( )。 #include <stdio.h> main() { int x,y=252,i=386,*m=y,*z=i; x=(z= =m); printf("%d",x); }A.252B.1C.0D.运行时出错,x无定值

以下程序的执行结果是 ______。 include int max(int x,int y) { ret 以下程序的执行结果是 ______。include<iostream.h>int max(int x,int y){return(x>y? x:y);}void main(){int n=2,m=10;max(n,m)--;cout<<"n="<<n<<",m="<<m<<endl;}

若有以下程序段;includeusing namespace std;int main(){ int a[]={1,4,5}; int *p=a[0],x=6,y,z; for(y=0;y<3;y++) z=((*(p+y)<x) ? *(p+y):x); cout<<z<<end1; return 0; } 程序运行后的输出结果是( )。A.1B.4C.5D.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

有以下程序:main{ int a[]=(2,4,6,8,10},y=0,x,*P;p=&a[1];for(x=1;x3;x++) y+=p[x];printf(%d\n,y);}程序运行后的输出结果是( )。A.A.10B.11C.14D.15

以下程序执行后的输出结果是include using namespace std;void try(int,int,int,int) 以下程序执行后的输出结果是 #include <iostream> using namespace std; void try(int,int,int,int); int main () { int x,y,z,r; x =1 ; y = 2; try(x,y,z,r); cout<<r<<endl; return 0; } void try(int x,int y,int z,int r) { z = x+y; x = x*x; y = y*y; r = z+x+y; }A.18B.9C.10D.不确定

以下程序执行后的输出结果是includeusing namcspace std;void try(int,int,int,int); 以下程序执行后的输出结果是 #include<iostream> using namcspace std; void try(int,int,int,int); int main() { int x,y,z,r; x=1; y=2; try(x,y,z,r); cout<<r<<end1; return 0; } void try(int x,int y, int z,int r) { z = x+y; x = x*x; y = y*y; r = z+x+y; }A.18B.9C.10D.不确定

有如下程序:inchdevoid fun(int x,int y){int t=x;x=y;y=t;}int main(){int a 有如下程序: #inchde<iostream.h> void fun(int x,int y){int t=x;x=y;y=t;} int main() { int a[2]={23,42); fun(a[1],a[0]); std::cout<<a[0]<<","<<a[1]<<Std::endl; return 0; } 执行后的输出结果是( )。A.42,42B.23,23C.23,42D.42,23

执行以下程序后的输出结果为( )。includeclass Sample{int x, y;public:Sample() { 执行以下程序后的输出结果为( )。#include<iostream. b>class Sample{ int x, y; public: Sample() { x=y=0;} Sample(int a, int b) {x=a; y=b; } void disp () { cout<<"x="<<x<<"y="<<y<<end1; }};void main(){ Sample s(2,3), *p=s; p->disp();}A.x=1, y=3B.x=2, y=4C.x=3, y=2D.x=2, y=3

以下程序执行后的输出结果是()。includeusing namespace std;void try(int,int,int,in 以下程序执行后的输出结果是( )。 #include<iostream> using namespace std; void try(int,int,int,int); int main() { int x,y,z,r; x=1; y=2; try(x,y,z,r); cout<<r<<endl; return 0; } void try(int x,int y, int z,int r) { z = x+y; X = x*x; y = y*y; r = z+x+y; }A.18B.9C.10D.不确定

以下程序执行后的输出结果是include.using namespace std;void try(int,int,int,int) 以下程序执行后的输出结果是 #include<iostream>. using namespace std; void try(int,int,int,int); int main() { int x,y,z,r; x=1; y=2; try(x,y,z,r); cout<<r<<end1; return 0; } void try(int x,int y, int z,int r) { z = x+y; x = x*x; y = y*y; r = z+x+y; }A.18B.9C.10D.不确定

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