有以下程序: include usingnamespacestd; classCFactorial { private:intvalue;intfac 有以下程序:include <iostream>using namespace std;class CFactorial{private:int value;int fact;public:CFactorial ( int val );void CalculateFactorial();void Display();};CFactorial :: CFactorial( int val ){value = val;fact = 1;}void CFactorial :: CalculateFactorial(){int i = value;while ( i > 1 )fact *= i--;}void CFactorial :: Display(){cout<<value<<"!="<<fact<<end1;}int main(){CFactorial A( 5 );A.CalculateFactorial();A.Display();return 0;}程序中,类CPactorial的功能是【 】,该程序运行的结果是【 】。

有以下程序: include usingnamespacestd; classCFactorial { private:intvalue;intfac

有以下程序:

include <iostream>

using namespace std;

class CFactorial

{

private:

int value;

int fact;

public:

CFactorial ( int val );

void CalculateFactorial();

void Display();

};

CFactorial :: CFactorial( int val )

{

value = val;

fact = 1;

}

void CFactorial :: CalculateFactorial()

{

int i = value;

while ( i > 1 )

fact *= i--;

}

void CFactorial :: Display()

{

cout<<value<<"!="<<fact<<end1;

}

int main()

{

CFactorial A( 5 );

A.CalculateFactorial();

A.Display();

return 0;

}

程序中,类CPactorial的功能是【 】,该程序运行的结果是【 】。


相关考题:

有以下程序:includeusing namespace std;class A{private:int a;public:A(int i){a=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 j) {b=j;} void disp() {cout<<b<<“,”;A.10,10,10B.10,12,14C.8,10,12D.8,12,10

有以下程序:includeusing namespace std;class sample{private:int x;public:sample( 有以下程序: #include<iostream> using namespace std; class sample { private: int x; public: sample(int A) { x=a; friend double square(sample s); }; double square(sample s) { return S.X*S.K; } int main() { saA.20B.30C.900D.400

有以下程序:includeusing namespace std;definePl 3.14Class Point{private:int x,y 有以下程序: #include<iostream> using namespace std; #definePl 3.14 Class Point {private: int x,y; public: Point(int a,intB) {X=a; y:b;} int getx() <return x;} int gety() {return y;}}; class Circle:public Point {priA.314B.157C.78.5D.153.86

有以下程序:include include using namespace std;class base{private: cha 有以下程序: #include <iostream> #include <string> using namespace std; class base { private: char baseName[10]; public: base ( ) { strcpy (baseName, "Base"); } virtual char *myName() {A.DerivedBaseB.BaseBaseC.DerivedDerivedD.BaseDerived

有以下程序:includeincludeusing namespace std; class point{private:double 有以下程序: #include<iostream> #include<math> using namespace std; class point { private: double x; double y; public: point(double a,double B) { x=a; y=b; } friend double distance (point a,point B) ;A.1B.5C.4D.6

有以下程序:includeusing namespace std;class BASE{private: char c;public: BASE(c 有以下程序: #include <iostream> using namespace std; class BASE { private: char c; public: BASE(char n):c(n);{} virtual~BASE() { cout<<c; } }; class DERIVED:public BASE { char c; pA.XYB.YXC.XD.Y

以下程序执行后输出的结果是【】。 include using namespace std; int fac(int a,int b){ 以下程序执行后输出的结果是【 】。include<iostream>using namespace std;int fac(int a,int b){return(b-a)*a;}int main(){int x=3,y=4,z=5,result;result=fac(fac(x,y),fac(x,z));cout<<result<<endl;return 0;}

有以下程序:include using namespace std;define PI 3.14class Point{ private:int 有以下程序: #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; }A.314B.157C.78.5D.153.86

若有以下程序:include using namespace std;class A{private: int a;public: A(int 若有以下程序: #include <iost ream> using namespace std; class A { private: int a; public: A(int i) { a=i; } void disp () { cout<<a<<", "; } }; class B { private:A.10,10,10B.10,12,14C.8,10,12D.8,12,10