Electronic clock 2:
The electronic clock shows the time in the h:mm:ss format, that is, the number of hours is recorded first, then the required two-digit number of minutes, then the two-digit number of seconds. The number of minutes and seconds, if necessary, are supplemented to two digits with zeros.
n seconds have passed since the beginning of the day. Output what the clock will show. Example: input - 3602, output - 1:00:02 You need to solve something like this with the help of a div, mod ... which I just don’t really understand, the solution can be written in C ++ or C #.
// I have already solved the first task of this type: Electronic clock 1:
Given the number n . n minutes have passed since the beginning of the day. Determine how many hours and minutes the electronic clock will show at that moment. The program should display two numbers: the number of hours (from 0 to 23) and the number of minutes (from 0 to 59). Note that the number n can be more than the number of minutes in a day.
var a, b, n:longint; begin readln(n); a:=(n div 60)mod 24; b:=n mod 60; writeln(a,' ',b); end. This is how the first version is solved, and how the second?