You will take value of seconds from user and display that seconds in hh:mm:ss format. You must use while loop to calculate hours and for loop to calculate minutes.
Example:
10000 seconds equals to 2 hours, 46 minutes, and 40 seconds. 2:46:40
Java ile bunu nasıl yazarım
4
●182
- 10-11-2019, 12:25:32Programlamada takıldığın yerlerde her zaman Stackoverflow ve benzeri sitelerde araştırma yapmanı tavsiye ederim.
/* cooper34 */ public class Main { public static void main(String[] args) { long input = 10000; long hours = (input - input%3600)/3600; long minutes = (input%3600 - input%3600%60)/60; long seconds = input%3600%60; System.out.println("Hours: " + hours + " Minutes: " + minutes + " Seconds: " + seconds+" "+hours+":"+minutes+":"+seconds); } } - 10-11-2019, 12:28:37Girdiyi kullanıcı yazacak.Cooper34 adlı üyeden alıntı: mesajı görüntüle
- 10-11-2019, 23:03:01hala ihtiyaç varsa yardımcı olayım hocamGGRIP adlı üyeden alıntı: mesajı görüntüle