39 lines
1.1 KiB
C++
39 lines
1.1 KiB
C++
#include <iostream>
|
|
#include "Time.h"
|
|
#include <string>
|
|
|
|
int main() {
|
|
std::cout << "Hello, World!" << std::endl;
|
|
Time a;
|
|
Time b(1, 45, 55);
|
|
Time c(20);
|
|
Time e(1, 65, 55);
|
|
Time f(25);
|
|
std::cout << a.toString() << "\n";
|
|
std::cout << b.toString() << "\n";
|
|
std::cout << c.toString() << "\n";
|
|
std::cout << e.toString() << "\n";
|
|
std::cout << f.toString() << "\n\n";
|
|
|
|
std::cout << a.toString12HourFormat() << "\n";
|
|
std::cout << b.toString12HourFormat() << "\n";
|
|
std::cout << c.toString12HourFormat() << "\n";
|
|
std::cout << e.toString12HourFormat() << "\n";
|
|
std::cout << f.toString12HourFormat() << "\n\n";
|
|
|
|
std::string tim1 = "01:42:48";
|
|
a = Time::parse(tim1);
|
|
tim1 = "01:62:48";
|
|
e = Time::parse(tim1);
|
|
std::cout << a.toString() << "\n";
|
|
std::cout << e.toString() << "\n\n";
|
|
std::cout << Time::isTimeValid(50, 22, 65)<< "\n";
|
|
|
|
const Time *g = new Time(20,56,5);
|
|
const Time *h = new Time(18,4,6);
|
|
|
|
std::cout << Time::maxTime(g,h)->toString();
|
|
|
|
return 0;
|
|
}
|