[单选题]

执行以下程序后的输出结果为( )。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=3

B.x=2, y=4

C.x=3, y=2

D.x=2, y=3

参考答案与解析:

相关试题

执行以下程序后的输出结果为( )。#includeclass Sample{in