mramine364

main.cpp (date)

Mar 12th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.58 KB | None | 0 0
  1. #include <iostream>
  2. #include "date.h"
  3.  
  4. using namespace std;
  5.  
  6.  
  7. int main() {
  8.  
  9.     date d1(1, 7, 2016), d2(1, 1, 1991);
  10.     d1 += 5;
  11.     d2 -= 4;
  12.     cout << d1 << " " << d2 << endl;
  13.  
  14.     int diff = d1 -d2;
  15.     cout << diff << endl;
  16.     cout << (d2 - 100) << " " << d1 + 100 << endl;
  17.  
  18.     int diff2 = ++d1 - d2++;
  19.     cout << diff2 << endl;
  20.     cout << d1 << " " << d2 << endl;
  21.  
  22.     if( d1>d2 )
  23.         cout << "d1>d2" << endl;
  24.  
  25.     cout << d1 << " " << d2 << endl;
  26.     if( d2.isBissextile() && d2!=d1 )
  27.         d2.PrintDate();
  28.     d2.PrintDate();
  29.     return 0;
  30. }
Add Comment
Please, Sign In to add comment