3. 写出程序运行的结果
#include
class Time { char a[9];
int hours;
int minutes;
int senconds;
public:
Time(int s=0, int m=0, int h=0){
hours=h;
minutes=m;
seconds=s;
}
void show( ){
cout 60)
{temp.senconds = temp.seconds - 60;temp.minutes++; }
if(temp.minutes > 60){ temp.minutes = temp.minutes - 60; temp.hours++;}
if(temp.hours >=24) temp.hours = temp.hours - 24;
return temp;
}
void main( )
{
Time T, T1(20, 23, 21), T2(10, 25, 15), T3(5, 10, 15);
T = T1 + T2;
T.show( );
T = T1 + T3;
T.show( );
}
答:
4. 阅读下面程序,回答题后的问题
//************************************************
#include
class A {
private:
//…其他成员
static int object_count;
public:
A(){A::object_count++;}
A~{ A::object_count--;}
int GetObjectCount(){return A::object_count;}
virtualvoid func(int data) { cout>choice[0];
cout>choice[1];
cout>choice[2];
cout<<"请给出你抽到的第四牌:";
cin&g
|