填空题

以下程序运行后的输出结果是______。
#include <iostream.h>
main()

int i=10,j=0;
do

j=j+i;i--;

while(i>2);
cout<<j;

【参考答案】

52
<上一题 目录 下一题>
热门 试题

填空题
以下程序的执行结果是______。 #include <iostream.h> class Sample int n; public: Sample() Sample(int m) n=m; int &operator--(int) n--; return n; void disp() cout<< n= <<n<<endl; ; void main() Sample s(10); (s--)++; s.disp();
填空题
在声明派生类时,如果不显式地给出继承方式,缺省的类继承方式是私有继承private。 已知有如下类定义: class Base protected: void fun() ; class Derived:Base; 则Base类中的成员函数fun(),在Derived类中的访问权限是______ (注意:要求填写private、protected或public中的一项)。
相关试题
  • 下面程序的执行结果是______。 #in...
  • 下面是用来计算n的阶乘的递归函数,请将该...
  • 已知f1(int)是类A的公有成员函数,并将...