Time decomposition (2)

Write a procedure

    void decompose(int n, int& h, int& m, int& s);

that, given a quantity of seconds @n@, computes how many hours @h@, minutes @m@ and seconds @s@ it represents. That is, we must have @s@ +60+ \ 60@m@ +3600+ \ 3600@h@ == @n@, with 00\le @s@ <60<60 and 00\le @m@ <60<60.

Precondition

nn is a natural number.

Observation

You only need to submit the required procedure; your main program will be ignored.

Problem information

Author: Unknown
Translator: Carlos Molina

Generation: 2026-01-25T10:15:58.877Z

© Jutge.org, 2006–2026.
https://jutge.org