Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.85 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _09.ClockPart2
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int minutes = 0;
  10.             int seconds = 0;
  11.  
  12.             for (int hours = 0; hours < 24; hours++)
  13.             {
  14.                 if(hours == 23)
  15.                 {
  16.                     minutes++;
  17.                 }
  18.                 for (minutes = 0; minutes < 60; minutes++)
  19.                 {
  20.                     if (minutes == 59)
  21.                     {
  22.                         seconds++;
  23.                     }
  24.                     Console.WriteLine($"{hours} : {minutes} : 0");
  25.                     for (seconds = 1; seconds < 60; seconds++)
  26.                     {
  27.                         Console.WriteLine($"{hours} : {minutes} : {seconds}");
  28.                     }
  29.                 }
  30.             }
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement