I am studying Delphi and faced with 2 tasks that I can not cope with.

The input file contains first the number N (1<=N<=100) , and then N times. Each moment of time is given by 3 integers - hours (from 0 to 23), minutes (from 0 to 60) and seconds (from 0 to 60). In the output file ANSWER.txt output the points in time, ordered in non-decreasing order (the moment in time is also displayed as three numbers, leading zeros are not necessary to output).

Sample input file:

 4 10 20 30 7 30 00 23 59 59 13 30 30 

Sample output file:

 7 30 0 10 20 30 13 30 30 23 59 59 

Help solve.

  • What specifically can not cope (coding, algorithm, Russian)? - timka_s

1 answer 1

One of the simplest solution methods is to present 3 numbers of time as one number. Those. 7.30.00 (from the example) is presented as 73000. Thus, you read the number of points in time, create an array, fill it with points in time in the above presentation. Next comes the simplest sorting of the array in ascending order and output to the output file. When withdrawing, we should again break our large number into three pairs less.