Basic Exercise Time conversiontime limit: 1.0s memory limit: 512.0MBThe problem description is given a time t in seconds, which requires the "<H>:<M>:<S>" format to represent the time. <H> indicates that time,<m> represents minutes, and <S> represents seconds, and they are integers and have no leading "0". For example, if t=0, the output should be "0:0:0", or "1:1:1" if t=3661. Input format input is only one line, which is an integer t (0<=t<=86399). Output format output is only one row, which is the time represented in the format "<H>:<M>:<S>", excluding quotation marks. Sample input 0 Sample Output 0:0:0 example input 5436 sample output 1:30:36
ImportJava.util.Scanner; Public classMain { Public Static voidMain (string[] args) {//TODO auto-generated Method StubScanner sc=NewScanner (system.in); intt=Sc.nextint (); intH=0,d=0,s=0; H=t/3600; D= (t-3600*h)/60; S=t-h*3600-d*60; System.out.println (H+ ":" +d+ ":" +s); }}
Basic Exercise Time Conversion