Добавил пример преобразования секунд
This commit is contained in:
parent
d40e4c660b
commit
6f497d3e7c
@ -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)
|
||||
|
11
code/C/seconds_to_minutes_and_hours.c
Executable file
11
code/C/seconds_to_minutes_and_hours.c
Executable file
@ -0,0 +1,11 @@
|
||||
#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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user