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@m@ + 3600@h@ = @n@, with 0≤ @s@  < 60 and 0≤ @m@  < 60.

Precondition

n 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
