commit 64c58125ce8e1850324835f67fa3eee125a48318 parent 99bd4688734d6e4f9c286b39e3288ea5eefde16c Author: mjkloeckner <martinjkloeckner@gmail.com> Date: Fri, 15 Mar 2024 12:26:01 -0300 Add solution for ej12 Diffstat:
| A | solutions/ej12.cpp | | | 16 | ++++++++++++++++ |
1 file changed, 16 insertions(+), 0 deletions(-) diff --git a/solutions/ej12.cpp b/solutions/ej12.cpp @@ -0,0 +1,16 @@ +#include <iostream> +#include <ctime> + +int main (void) { + unsigned long in_time_secs; + + std::cin >> in_time_secs; + + time_t seconds(in_time_secs); + tm *p = gmtime(&seconds); + + std::cout << p->tm_yday << " days, " + << p->tm_hour << ":" << p->tm_min << ":" << p->tm_sec << std::endl; + + return 0; +}
