有如下定义:int x[]={1,2,3},*p=x,y; 则y=*p++;相当于_____A.y=x[0], p++B.y=*p, p++C.y=1, x++D.y=*(p+1), p=p+1E.y=2, p=x[1]F.y=2, p=x+1

有如下定义:int x[]={1,2,3},*p=x,y; 则y=*p++;相当于_____

A.y=x[0], p++

B.y=*p, p++

C.y=1, x++

D.y=*(p+1), p=p+1

E.y=2, p=&x[1]

F.y=2, p=x+1


参考答案和解析
'x=123'

相关考题:

若有如下函数模板定义,则正确使用该函数模板的语句是( )。templatevoid add(type a, type b, type 和c){ c=a+b ; } A.float x,y,z;add(x,y,z) ;B.int x,y,z;add(x,y,和z) ;C.float x,y ;int z;add(x,y,z) ;D.float x,y ;int z;add(x,y,和z) ;

有如下定义#define D 2int x=5;float y=3.83;char c=′D′;则下面选项中错误的是A.x++;B.y++;C.c++;D.D++;

( 29 )有如下程序:#includeiostreamusing namespace std;class Part{public:Part(int x=0):val(x) {coutval;}~Part(){coutval;}private:int val;};class Whole{public:Whole(int x ,int y, int z=0):p2(x),p1(y),val(z){coutval;}~Whole(){coutval;}private:Part p1,p2;int val;};int main(){Whole obj(1,2,3);return 0;}程序的输出结果是A ) 123321B ) 213312C ) 213D ) 123123

( 9 )有如下的函数定义:int Xfun(int x){int y=x;{int x=10; y+=x;}return x+y;}通过表达式 Xfun(5) 调用该函数,则得到的返回值为 【 9 】 。

有如下程序:includevoid main(){int x=2,y=3,a,b,c,d;a=(x++>=--y);b=(x==++y);c=(x 有如下程序:include<iostream.h>void main(){int x=2,y=3,a,b,c,d;a=(x++>=--y);b=(x==++y);c=(x--!=y);d=(++x>y--);Cout<<a<<b<<c<<d<<end1;}则程序执行后变量a,b,c,d的值分别是【 】。

有如下程序: include using namespace std; class Part{ public: 有如下程序: #include <iostream> using namespace std; class Part{ public: Part(int x=0):val(x) { cout<<val; } ~Part() { cout<<val; } private: int val; }; class Whole { public: Whole(int x, int y, int z=0):p2(x),p1 (y),val(z) { cout<<val; } ~whole() { cout<<val; private: Part p1,p2; int val; }; int main() { Whole obj (1,2,3); return 0; }程序的输出结果是A.123321B.213312C.213D.123123

现有如下程序段#include "stdio.h"int aa(int x,int y);main(){int a=24,b=16,c;c=aa(a,b);printf("%d\n",c);}int aa(int x,int y){int w;while(y){w=x%y;x=y;y=w;}return x;}则程序段的输出结果是A.8B.7C.6D.5

有以下定义:“int a;long b;double X,Y;”,则以下选项中正确的表达式是( )。 A.a%(int x—y)SXB 有以下定义:“int a;long b;double X,Y;”,则以下选项中正确的表达式是( )。A.a%(int x—y)B.a=x!=Y;C.(a*y)%bD.y=x+y=X

设有如下定义:int x=1,y=-1;则下列语句的输出结果是______。printf("%d\n",(x--++y));A.1B.0C.-1D.2

有如下程序:includeusing namespace std;class Part{public:Part(int x=0):val(x){co 有如下程序: #include<iostream> using namespace std; class Part{ public: Part(int x=0):val(x){cout ~Part( ){cout<<val;} pritave: int val; }; class Whole{ public: Whole(int x,int Y,int z=0):p2(x),p1(Y),val(z){cout<<val;} ~Whole( ){cout<<val;} pritave: Part p1,p2; int val; f; int main( ){ Whole obj(1,2,3); return 0; } 程序的输出结果是A.123321B.213312C.213D.123123

有如下程序: include using namespace std; void f1(int x, int y){int z= 有如下程序:#include<iostream>using namespace std;void f1(int x, int y){int z=x; x=y; y=z;)void f2(int x, int y){int z=x; x=y; y=z;}intmain(){int x=10, y=26;f1(x, y);f2(x, y);cout<<y<<end1;return 0;}运行时的输出结果是( )。A) 10B) 16C) 26D) 36A.B.C.D.

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

设有如下定义 int x=10,y=3,z; 则语句 printf("%d\n",z=(x%y,x/y)); 的输出结果是( )A.3B.0C.4D.1

主调函数中的两个变量a和b,要求调用函数交换a、b的值,返回交换结果,则以下正确的函数是______。A.funa(int*x,int*y) {int*p; *p=*x;*x=*y;*y=*p; }B.funb(int x,int y) {int t; t=x;x:y=y=t;}C.func(int*x,int*y) {*x=*y;*y=*x;}D.fund(int *x,int*y) {*x=*x+*y;*y=*x-*y;*x=*x-*y;}

有如下程序void f(int *x,int *y){ int t; t=*x;*x=*y;*y=t;}main(){ int a[6]={1,2,4,6,8,10},i,*p,*q; p=a;q=a[5]; while(pq) { f(p,q); p++; q--; } for(i=0;i6;i++) printf("%d,",a[i]);}该程序的输出结果是A.1,2,4,6,8,10 B.10,8,4,6,2,1C.10,8,6,4,2,1 D.10,2,4,6,8,1

有如下程序:include using namespace std;class point{int x, y;public:point( int v 有如下程序:#include <iostream>using namespace std;class point{ int x, y;public: point( int vx, int vy ) { X=vx; y=vy; } point() { x=0; y=0; } point operator+ ( point p1 ) { point p; int px = x + p1.x; int py = y+ p1.y; return point( px, py ); } point operator-( point p1 { point p; int px = x - p1.x; int py = y - p1.y; return point( px, py ); } void print() { cout<<x<<","<<y<<end1; }};int main(){ point p1( 10, 10 ), p2( 20, 20 ); p1 = p1 + p2; p1.print(); return ();}执行后的输出结果是( )。A.10, 10B.20, 20C.10, 20D.30, 30

若有如下定义: int x=6,y=3,z=2; 则表达式x=y||y<zz==z的值是( )。A.0B.1C.4D.6

设有如下定义: int x=10,y=3,z; 则语句printf("%d\n",z=(x%y,x/y)); 的输出结果是( )。A.1SX 设有如下定义: int x=10,y=3,z; 则语句printf("%d\n",z=(x%y,x/y)); 的输出结果是( )。A.1B.0C.4D.3

有如下程序: #jnCludeiostream using namespaCe std; Class Part{ publiC: Part(int x=0):val(X){Coutval;} ~Part{Coutval;} private: int val; t }; Class Whole{ publiC: Whole(int x,int Y,int z=0):p2(x),pl(y),val(z){Coutval;} ~Whole{eoutval;} private: Part pl,p2; int val; }; int main { Whole obj(1,2,3); return 0; } 执行这个程序的输出结果是( )。A.123321B.213312C.213D.123123

有如下程序:include using namespace std;class point{intx,y;public:point( int vx, 有如下程序:#include <iostream>using namespace std;class point{ int x, y;public: point( int vx, int vy ) { x = vx; y = vy; } point ( ) x = 0; y= 0; } point operator+( point p1 ) { point p; int px = x+ p1.x; int py = y + p1.y; return point( px, py ); point operator-( point p1 ) { point p; int px = x -p1.x; int py = y - p1.y; return point ( px, py ); } void print() { cout<<x<<" , "<<y<<end1; }};int main (){ point p1(10, 10 ), p2( 20, 20 ); p1 = p1 - p2; p1.print (); return 0;} 执行后的输出结果是A.10,10B.20,20C.10,20D.30,30

有以下定义:int a;long b;double x,y;则以下选项中正确的表达式是( )。A.a%(int)(x-y)B.a=x!=y;C.(a*y)%bD.y=x+y=x

若有如下定义: int x=3,y=2,Z; 则表达式Z=X/y*3.0的值是( )。A.2B.2C.3D.3

有如下程序: include using namespace std; class point {int x,y; public:point( i 有如下程序: #include <iostream> using namespace std; class point { int x, y; public: point( int vx, int vy ) { x = vx; y = vy; } point ( ) { x = 0; y = 0; } point operator+( point pl ) { point p; int px = x + p1.x; int py = y + p1.y; return point( px, py ); } point operator-( point p1 ) { point p; int px = x - p1.x; int py = y - p1.y; return point( px, py ); } void print() { cout<<x<<", "<<y<<end1; } }; int main () { point pl ( 10, 10 ), p2 ( 20, 20 ); p1 = p1 + p2; p1.print (); return 0; } 执行后的输出结果是( )。A.10,10B.20,20C.10,20D.30,30

若已有以下定义和语句: #include       int x=4,y=3,*p,*q,*s;  p=x; q=y; s=q; q=NULL;  则下面分别给出的四条语句中,错误的是()A、*q=0;B、s=p;C、*p=x;D、*p=*s;

设有如下定义:int x=l,y=-1;,则语句:printf("%d/n",(x--++y));的输出结果是()A、1B、0C、-1D、2

下列语句执行后的结果是()。 y=5;p=y;x=*p++;A、x=5,y=5B、x=5,y=6C、x=6,y=5D、x=6,y=6

单选题若已有以下定义和语句: #include       int x=4,y=3,*p,*q,*s;  p=x; q=y; s=q; q=NULL;  则下面分别给出的四条语句中,错误的是()A*q=0;Bs=p;C*p=x;D*p=*s;

单选题有以下定义int a;long b;double x,y;则以下选项中正确的表达式是(  )。A(a*y)%bBa==xyCa%(int)(x-y)Dy=x+y=x