填空题
以下程序的执行结果是______。
#include<iostream.h>
#include<stdliB.h>
class Sample
public:
int x, y;
Sample()x=y=0;
Sample(int a, int b)x=a;y=b;
void disp()
cout<<"x="<<x<<", y="<<y<<end1;
;
void main()
Sample s1(2,3);
s1.disp();
【参考答案】
x=2,y=3
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
填空题
下列函数的功能是判断字符串str是否对称,对称则返回true,否则返回false。请在横线处填上适当内容,实现该函数。 bool fun(char *str) int i=0,j=0; while(str[j]) j++; for(j--;i<j && str[i]==str[j]; i++,j--); return i______j;
点击查看答案&解析
填空题
有如下类声明: class MyClass int i; private: int j; protected: int k; public: int m, n; ; 其中,私有成员的数量为______。
点击查看答案&解析
相关试题
某二叉树中度为2的结点有12个,则该二叉...
阅读下面的程序: #include<iostream.h...
类MyClass的定义如下: class MyClass p...
以下程序段是函数返回a所指数组中最大的值...
有如下程序: #include<iostream> usi...