//头文件
#ifndef TIME_H
#define TIME_H
#include <iostream>
#include <iomanip>
#include <array>
using namespace std;
class Time
{
public:
Time(int,int,int);
~Time();
void setTime(int,int,int);
void printStandard();
void tick();
private:
int hour;
int minute;
int second;
};
#endif
#include "Time.h"
Time::Time(int hh,int min,int sec)
{
setTime(hh,min,sec);
}
Time::~Time()
{
}
void Time::setTime(int hh, int min, int sec)
{
if (hh >= 0 && hh <24)
hour = hh;
if (min >= 0 && min < 60)
minute = min;
if (sec >= 0 && sec < 60)
second = sec;
}
void Time::printStandard()
{
cout <<setw(2)<<setfill('0')<<(( hour % 12==0 && hour>=12) ? 12:hour%12)<< ":" <<setw(2)<<setfill('0')<< minute << ":" <<setw(2)<<setfill(