TOPCoder (i) time

Source: Internet
Author: User

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)
0
Returns: "0:0:0"
1)
3661
Returns: "1:1:1"
2)
5436
Returns: "1:30:36"
3)
86399
Returns: "23:59:59"

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.