Advertisement
psi_mmobile

Untitled

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