consolidate all repos to one for archive

This commit is contained in:
2025-01-28 13:46:42 +01:00
commit a6610fbc7a
5350 changed files with 2705721 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
#include "Date.h"
std::ostream& operator<<(std::ostream &out, const Date &date) {
return out << date.toString();
}
Date::Date(unsigned int day, unsigned int month, unsigned int year) : day(day), month(month), year(year) {}
std::string Date::toString() const {
return std::to_string(day) + ", " + std::to_string(month) + ", " + std::to_string(year);
}
bool Date::operator==(const Date &other) const {
return this->year == other.year && this->month == other.month && this->day == other.day;
}
//prefix ++a
Date& Date::operator++() {
day++;
if(months[month-1] < day){
month++;
day = 1;
}
if(month == 13){
year++;
month = 1;
}
return *this;
}
//postfix a++
Date Date::operator++(int dummy) {
Date tmp(day,month,year);
day++;
if(months[month-1] < day){
month++;
day = 1;
}
if(month == 13){
year++;
month = 1;
}
return tmp;
}