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

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

有定义:int x,y=10,*p=&y;, 则能使得x的值也等于10的语句是()。

  • A、x=p;
  • B、x=&p;
  • C、x=&y;
  • D、x=*p;

参考答案

更多 “有定义:int x,y=10,*p=y;, 则能使得x的值也等于10的语句是()。A、x=p;B、x=p;C、x=y;D、x=*p;” 相关考题
考题 请将以下程序中的函数声明语句补充完整。#include stdio.hint 【 1 2 】 ;main(){ int x,y,(*p)();scanf("%d%d",x,y);p=max;printf("%d\n",(*p)(x,y));}int max(int a,int b){ return(ab?a:b);}

考题 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

考题 在下面的类定义中,this指针的用途是______。 include class Sample { int x,y; publi 在下面的类定义中,this指针的用途是______。include<iostream.h>class Sample{int x,y;public:Sample(int i,int j){x=i;y=j;}void assign(Sample sa);};void Sample::assign(Sample p){if(this!=p){x=p.x;y=p.y;}}

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

考题 主调函数中的两个变量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;}

考题 主调函数中的两个变量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;}

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

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

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

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

考题 有如下程序:includeusing namespace std;class point{int x,y;public:point(int vx,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 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(); retrun 0; } 执行后的输出结果是A.10,10B.20,20C.10,20D.30,30

考题 设有定义语句“int x=10, *p=&x”,则表达式的值为10的有( )。 A、pB、*pC、*&xD、*p=xE、x=*p

考题 设int x[ ]={2,4,6,8},y,*p=x[1];则执行语句y=(*--p)++;后数组元素x[0]的值为 ______。A.2B.3C.4D.5

考题 有以下程序:includeincludeusingnamespacestd;classDistance;classpoint{pub 有以下程序: #include <iostream> #include <cmath> using namespace std; class Distance; class point { public: friend class Distance; Point(int a,int B) { x=a; Y=b; } void Print() { cout<<"X= "<<X<<end1; cout<<"Y= "<<Y<<end1; } private: float X,Y; }; class Distance { public: float Dis(Point p,Point q); }; float Distance :: Dis(Point p,Point q) { float result; result=sqrt((p.X-q.X)*(p.X-q.X)+(p.Y-q.Y)*(p.Y-q.Y)); cout<<result<<end1; retUrn result; } int main() { Point p(10,10),q(10,30); Distance d; d.Dis(p,q); return 0; } 运行后的输出结果是( )。A.10B.30C.0D.20

考题 某随机事件最多只有X、Y、Z三种互不相同的结果,关于X、Y、Z发生的概率,下列各项有可能的是( )。 A. P(X) =1, P(Y) = -1, P(Z) =1 B. P(X) =0.3, P(Y) =0.2,P(Z) =0.5 C. P(X) =P(Y) =P(Z) =1 D. P(X) >0, P(Y)= -P(X),P(Z) =1

考题 若已有以下定义和语句: #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;

考题 判断下列公式是否为可合一,若可合一,则求出其最一般合一。 (1)P(a,b),P(x,y) (2)P(f(x),b),P(y,z) (3)P(f(x),y),P(y,f(b)) (4)P(f(y),y,x),P(x,f(a),f(b)) (5)P(x,y),P(y,x)

考题 有以下说明语句:struct point{int x;int y;}p;则正确的赋值语句是()A、point.x=1;point.y=2;B、point={1,2};C、p.x=1;p.y=2;D、p={1,2};

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

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

考题 单选题有以下说明语句:struct point{int x;int y;}p;则正确的赋值语句是()A point.x=1;point.y=2;B point={1,2};C p.x=1;p.y=2;D p={1,2};

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

考题 单选题若已有以下定义和语句: #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,y=10,*p=y;, 则能使得x的值也等于10的语句是()。A x=p;B x=p;C x=y;D x=*p;