Advertisement
MasterGun

Time

Sep 27th, 2020 (edited)
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.77 KB | None | 0 0
  1.     struct date
  2.     {
  3.         int day = 27;
  4.         string month = "September";
  5.         int year = 2020;
  6.         int day_max = 31;
  7.     };
  8.     struct times
  9.     {
  10.         int hour = 11;
  11.         int minutes = 15;
  12.         int seconds = 25;
  13.         int hour_max = 24;
  14.         int minutes_max = 59;
  15.         int seconds_max = 59;
  16.     };
  17.     void show()
  18.     {
  19.         date d;
  20.         times t;
  21.         if (d.day <= d.day_max)
  22.         {
  23.             cout << d.day << " " << d.month << " " << d.year << endl;
  24.         }
  25.         else
  26.         {
  27.             cout << "Well... Something gone wrong" << endl;
  28.         }
  29.         if (t.hour <= t.hour_max, t.minutes <= t.minutes_max, t.seconds <= t.seconds_max)
  30.         {
  31.             cout << t.hour << ":" << t.minutes << ":" << t.seconds << endl;
  32.         }
  33.         else
  34.         {
  35.             cout << "Well... Something gone wrong" << endl;
  36.         }
  37.     }
  38.  
  39. int main()
  40. {
  41.     setlocale(LC_ALL, "rus");
  42.     show();
  43.     return 0;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement