I have to write a program in C++ that takes 2 user input dates in the format DD.MM.YYYY hh:mm:ss (within the 01.01.0000 00:00:00 to 31.12.9999 23:59:59 range), calculate the difference between them and output it in format [days]hh:mm:ss (without days if its under 24h). I cannot use loops or arrays.
Example values:
Date1, Date2/Result
23.10.2020 19:24:10, 24.10.2020 20:18:11 / [1]00:54:01;
29.02.2020 19:24:10, 28.02.2020 20:18:11 / 23:05:59;
29.02.2019 19:24:10, 28.02.2020 20:18:11 / Invalid date/time;
15.4.48 2:3:18, 25.2.9876 14:12:0 / [3589553]12:08:42;
Aucun commentaire:
Enregistrer un commentaire