若有以下程序: #include <iostream> using namespace std; int f() { static int i = 0; int s = 1; s+=i; i++; return s; } int main() { int i,a = 0; for(i = 0;i<5;i++) a+=f(); cout<<a<<endl; return 0; } 程序运行后,输出的结果是
A.20
B.24
C.25
D.15
[单选题]若有如下程序:include using namespace std;int main(){ char *p="abcdefgh",*r; lon若有如下程序: #include <iostream> using namespace std; int main() { char *p="abcdefgh",*r; long *q; q=(long *)p; q++; r=(char *)q; cout<<r<<end1; return 0; } 上述程序的输出结果是( )。A.abcde
[主观题]若有以下程序: include using namespace std; class sample { int x; public: sample若有以下程序:include <iostream>using namespace std;class sample{int x;public:sample(){}void setx(int i){x=i;}friend iht fun(sample B[],int n){int m=0;for{int i=0;i<n;i++)if(B[i].x>m)
[单选题]若有以下程序include using namespace std;class A{public: A(int i,int j) {a=i;b=j若有以下程序 #include <iostream> using namespace std; class A { public: A(int i,int j) { a=i; b=j; } void move(int x, int y) { a+=x; b+=y; } void show() { cout < <a < <" , " <<b<< e
[单选题]若有以下程序:include using namespace std;class Base {public:Base() { x=0; } int若有以下程序: #include <iostream> using namespace std; class Base { public: Base() { x=0; } int x; }; class Derivedl: virtual public Base { public: Derivedl() { x=10; } }; class Deriv
[单选题]若有以下程序:include using namespace std;define PI 3.14class Point{private: in若有以下程序: #include <iostream> using namespace std; #define PI 3.14 class Point { private: int x,y; public: Point(int a,int b) { x=a; y=b; } int getx() { return x; } int gety() { re
[单选题]若有以下程序:include using namespace std;class A{private: int a;public: A(int i若有以下程序: #include <iostream> using namespace std; class A { private: int a; public: A(int i) { a=i; } void disp() { cout<<a<<", "; } }; class B { private: int b; public: B(int
[单选题]若有以下程序: include using namespace std;class Base{public:Base ( ){x=0;}int x若有以下程序:# include <iostream>using namespace std;class Base{public: Base ( ) { x=0; } int x;};class Derived1 : virtual public Base{public: Derived1 ( ) { x=10; }}; class Derived2
[单选题]若有以下程序:include using namespace std;class Base{public:Base (){x=0;}int x;}若有以下程序: #include <iostream> using namespace std; class Base { public: Base () { x=0; } int x; }; class Derived1 : virtual public Base { public: Derived1 () { x=10; } }; class De
[单选题]若有以下程序:include using namespace std;class A{private:int a;public:A(int i){若有以下程序: #include <iostream> using namespace std; class A { private: int a; public: A(int i) { a=i; } void disp () { cout<<a<<","; } }; class B { private: int b; public: B(int
[单选题]若有以下程序:include using namespace std;class A{public:A() { }A(int i){x1=i;}v若有以下程序: #include <iostream> using namespace std; class A { public: A() { } A(int i) { x1=i; } void dispa0 { cout<<"x1="<<x1<<","; } private: int x1; }; class B: public A { p