#include<iostream>
using namespace std;
class thoiGian{
private :
int ngay;
int thang;
int nam;
public :
thoiGian(){
ngay = 1;
thang = 1 ;
nam = 2012;
}
int get_ngay(){
return ngay;
}
int get_thang(){
return thang;
}
int get_nam(){
return nam;
}
int ngayCuoiThang(){
if( thang == 2 ){
if( kiemTraNhuan() == true){
return 29;
}
return 28;
}else{
if( thang == 4 || thang == 6 || thang == 9 || thang == 11){
return 30;
}
return 31;
}
}
bool kiemTraNhuan(){
if(nam%400 == 0){
return true;
}
if(nam % 4 == 0 && nam % 100 == 0){
return true;
}
return false;
}
void xuat(){
cout << "Thoi gian : " << ngay
<<"/" << thang
<<"/" << nam
<< endl
; }
void nhap(){
do{
cout << "Nhap nam : " ; cin >> nam
; }while( nam < 0);
do{
cout << "Nhap thang : " ; cin >> thang
; }while( 1 > thang || thang > 12);
do{
cout << "Nhap ngay : " ; cin >> ngay
; }while( ngay < 0 || ngay > ngayCuoiThang() );
}
bool operator==( thoiGian s){
if( s.nam == nam && s.thang == thang && s.ngay == ngay ){
return true;
}
return false;
}
};
int main(){
thoiGian t,s;
t.nhap();
t.xuat();
s.nhap();
s.xuat();
if( s == t){
cout << "2 thoi gian trung nhau "; }else{
cout << "2 thoi gian khong trung nhau" }
}