Добавиил пример преобразования секунд
This commit is contained in:
parent
3ff42756d4
commit
bf8012db5c
24
content/posts/2024/examples/seconds-to-minutes-and-hours.md
Normal file
24
content/posts/2024/examples/seconds-to-minutes-and-hours.md
Normal file
@ -0,0 +1,24 @@
|
||||
---
|
||||
title: "🕰️ Преобразование секунд в минуты и часы"
|
||||
date: 2024-01-28T20:18:33+03:00
|
||||
draft: false
|
||||
tags: [c, cpp, tips, development]
|
||||
---
|
||||
|
||||
### Пример на Си
|
||||
|
||||
```c
|
||||
#include <stdio.h>
|
||||
|
||||
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;
|
||||
}
|
||||
```
|
||||
|
||||
🗨️ [Вопросы и предложения](https://t.me/db_o_qp)
|
Loading…
Reference in New Issue
Block a user