#include<iostream>
#include<windows.h>
using namespace std;
class Cicle{
public:
Cicle(int x)
{
curr=x;
}
int get()
{
return curr;
}
int curr;
};
class Clock{
private:
int clock;//时
Cicle c1;//分
Cicle c2;//秒
public:
Clock(int h,int m,int s):c1(m),c2(s){
clock=h;
}
int geth()
{
return clock;
}
void displayTime()
{
while(1)
{
cout<<clock<<":"<<c1.curr<<":"<<c2.curr<<endl;
Sleep(1000);
system("cls");
if(!(c2.curr=++c2.curr%60))
if(!(c1.curr=++c1.curr%60))
clock=++clock%24;
}
}
};
int main()
{
Clock CLOCK(23,59,59);
CLOCK.displayTime();
return 0;
}
#include<windows.h>
using namespace std;
class Cicle{
public:
Cicle(int x)
{
curr=x;
}
int get()
{
return curr;
}
int curr;
};
class Clock{
private:
int clock;//时
Cicle c1;//分
Cicle c2;//秒
public:
Clock(int h,int m,int s):c1(m),c2(s){
clock=h;
}
int geth()
{
return clock;
}
void displayTime()
{
while(1)
{
cout<<clock<<":"<<c1.curr<<":"<<c2.curr<<endl;
Sleep(1000);
system("cls");
if(!(c2.curr=++c2.curr%60))
if(!(c1.curr=++c1.curr%60))
clock=++clock%24;
}
}
};
int main()
{
Clock CLOCK(23,59,59);
CLOCK.displayTime();
return 0;
}