|
Class: |
Time |
Method: |
Whattime |
Parameters: |
Int |
Returns: |
String |
Method Signature: |
String whattime (int seconds) |
(Be sure your method was public) |
|
Limits |
|
Time limit (s): |
2.000 |
Memory Limit (MB): |
64 |
|
Constraints |
- |
seconds 'll be between 0 and 24*60*60-1 = 86399, inclusive. |
Examples |
0) |
|
|
|
1) |
|
|
|
2) |
|
|
|
3) |
|
|
|
This problem statement are the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly p Rohibited. (c) 2003, TopCoder, Inc. All rights reserved.
The first one to use the platform, feel a little bit ignorant. The topic is not the same as the general.
Accode:
Import Java.util.scanner;public class Time {public String whattime (int seconds) {int h = seconds/(60*60); seconds = seconds -h* (60*60); int m = Seconds/60;seconds = Seconds-m*60;int s = Seconds;return H + ":" +m+ ":" +s;} public static void Main (string[] args) {Scanner cin = new Scanner (system.in); Time time = new Time (), int seconds = Cin.nextint (); System.out.println (Time.whattime (seconds));}}
For the first time, do a question on this.
TOPCoder (i) time