有如下程序: #include<iostream> using namespace std; int i=1; class Fun { public: static int i; int value(){return i-1;} int value()const{return i+1;} }; int Fun::i=2; int main() { int i=3; Fun fun 1; const Fun fun2; ______ return 0; } 若程序的输出结果是: 123 则程序中横线处的语句是( )。
A.cout<<fun1.value()<<Fun::i<<fun2.value();
B.cout<<Fun::i<<fun1.value()<<fun2.value();
C.count<<fun.value()<<fun2.value()<<Fun::i;
D.cout<<fun2.value()<<Fun::i<<fun1.value();
[单选题]有如下程序:#includeusing namespace std;int main(){void function(double val);double val;function(val);cout<return 0;}void function(double val){val = 3;}编译运行这个程序将出现的情况是A. .编译出错,无法运行B. .输出: 3C. .输出: 3.0D. .输出一个不确定的数
[单选题]有如下程序:includeusing namespace std;int s=0;class sample{ static int n;public有如下程序: #include<iostream> using namespace std; int s=0; class sample { static int n; public: sample(int i) { n=i; } static void add() { s+=n; } }; int sample::s=0; int main() {
[单选题]有如下程序:includeusing namespace std;int main(){ cout.fill('*'); cout.width(5)有如下程序: #include<iostream> using namespace std; int main() { cout.fill('*'); cout.width(5); cout<<scientific<<315926535<<endl; retrun 0; } 程序运行后,输出的结果是( )。A.3.14E+02B.3.14E+
[单选题]有如下程序:includeusing namespace std;int main(){cout.fill('*');cout.width(6);c有如下程序: #include<iostream> using namespace std; int main() { cout.fill('*'); cout.width(6); cout.fill('#'); cout<<888<<end1; return 0; } 的执行结果是( )。A.###888B.888###C. ***88
[单选题]有如下程序:includeusing namespace std;int main(){int *p;*p=9;cout<<"The value a有如下程序: #include<iostream> using namespace std; int main() { int *p; *p=9; cout<<"The value at p:"<<*p; return 0; } 编译运行程序将出现的情况是( )A.编译时出现语法错误,不能生成可执行文件B.运行时一定输出:The value a
[单选题]若有如下程序段:includeusing namespace std;int main (){char*p="abcdefgh",*r;r=p;若有如下程序段: #include<iostream> using namespace std; int main () { char*p="abcdefgh",*r; r=p; cout<<*r<<end1; return 0; } 该程序的输出结果是( )。A.aB.bC.cD.d
[单选题]若有如下程序:includeusing namespace std;int s=0;class sample{static int n;publi若有如下程序: #include<iostream> using namespace std; int s=0; class sample { static int n; public: sample(int i) { n=i; } static void add() { S+=n; } }; int sample::n=0; int main() {
[单选题]有如下程序:#includeusing namespace std;class A{public:A.(){cout<<"A";}~A(){cout<<"~A";}};class B:public A{A.* p;public:B.(){cout<<"B"; p = new A();}~B(){cout<<"~B"; delete p;}};int main(){B. obj;return 0;}执行这个程序的输出结果是A. . B
[单选题]有如下程序:#includeusing namespace std;class Base{private:void funl() const{cout<<"funl";}protected:void fun2() const{cout<<"fun2";}public:void fun3() const{cout<<"fun3";}};class Derived:protected Base{public:void fun4() const{cout
[单选题]有如下程序:#includeusing namespace std;class Complex{double re, im;public:C.omplex(double r, double i):re(r), im(i){}double real() const{return re;}double image() const{return im;}C.omplex& operator +=(Complex a){re += a.re;im += a.im;return *this;}};