From 32af7dad6a6e8b29570b44e5e81665a20b571521 Mon Sep 17 00:00:00 2001 From: Gerasimos Christodoulou <36819046+xgerasimos@users.noreply.github.com> Date: Wed, 21 Feb 2024 12:31:51 +0200 Subject: [PATCH] Update Solution.cs When the value of variable m is 1, we should express it as "one minute" instead of "one minutes." --- Algorithms/Implementation/The Time in Words/Solution.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Algorithms/Implementation/The Time in Words/Solution.cs b/Algorithms/Implementation/The Time in Words/Solution.cs index 1073e7e..bc0cd9b 100644 --- a/Algorithms/Implementation/The Time in Words/Solution.cs +++ b/Algorithms/Implementation/The Time in Words/Solution.cs @@ -26,11 +26,12 @@ static void Main(String[] args) , "eleven", "twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen","twenty" , "twenty one", "twenty two", "twenty three", "twenty four", "twenty five", "twenty six", "twenty seven", "twenty eight","twenty nine" }; - if (m == 0) Console.Write($"{hourWords[h - 1]} o' clock"); - if ((m > 0 && m < 15) || (m > 15 && m < 30)) + if ( m == 1 ) + Console.Write($"{minuteWords[0] minute past {hourWords[h - 1]}"); + else if ((m > 0 && m < 15) || (m > 15 && m < 30)) Console.Write($"{minuteWords[m - 1]} minutes past {hourWords[h - 1]}"); if ((m > 30 && m < 45) || (m > 45 && m < 60))