Advertisement
psi_mmobile

Untitled

May 15th, 2022
730
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.63 KB | None | 0 0
  1. //10.   Часовник - част 2
  2. public class MyClass {
  3.     public static void main(String args[]) {
  4.        int maxMinuteAndSeconds = 59;
  5.        int maxHour = 23;
  6.        int currentHour = 0;
  7.        while (currentHour <= maxHour) {
  8.            for (int i = 0; i <= maxMinuteAndSeconds; i++) {
  9.                for (int j = 0; j <= maxMinuteAndSeconds; j++) {
  10.                     System.out.printf("%d : %d : %d\n",currentHour,i,j); //needed softuni solution
  11.                /* System.out.printf("%02d : %02d : %02d\n",currentHour,i,j); //proper solution */
  12.                }
  13.            }
  14.            currentHour++;
  15.        }
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement