From 6f497d3e7c3cdefba840bc2725ad0bcb73ff6e08 Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Sun, 28 Jan 2024 20:17:27 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=BF=D1=80=D0=B8=D0=BC=D0=B5=D1=80=20=D0=BF=D1=80=D0=B5=D0=BE?= =?UTF-8?q?=D0=B1=D1=80=D0=B0=D0=B7=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20?= =?UTF-8?q?=D1=81=D0=B5=D0=BA=D1=83=D0=BD=D0=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/C/README.md | 4 ++++ code/C/seconds_to_minutes_and_hours.c | 11 +++++++++++ 2 files changed, 15 insertions(+) create mode 100755 code/C/seconds_to_minutes_and_hours.c diff --git a/code/C/README.md b/code/C/README.md index de3d001..e801ecd 100644 --- a/code/C/README.md +++ b/code/C/README.md @@ -1,5 +1,9 @@ # C +## Other + +- [seconds_to_minutes_and_hours.c](seconds_to_minutes_and_hours.c) - Преобразование секунд в минуты и часы + ## SQLite 3 - [CREATE TABLE](sqlite/sqlite3_create.c) diff --git a/code/C/seconds_to_minutes_and_hours.c b/code/C/seconds_to_minutes_and_hours.c new file mode 100755 index 0000000..1da2597 --- /dev/null +++ b/code/C/seconds_to_minutes_and_hours.c @@ -0,0 +1,11 @@ +#include + +int main(int argc, char const *argv[]) { + unsigned int seconds = 800000 + 61; + unsigned int minutes = seconds / 60; + unsigned int hours = minutes / 60; + + printf("H: %d\nM: %d\nS: %d\n", hours, minutes % 60, seconds % 60); + + return 0; +}