diff --git a/HomeWork.cs b/HomeWork.cs index 821b44c..1e400ef 100644 --- a/HomeWork.cs +++ b/HomeWork.cs @@ -335,6 +335,21 @@ return snakeArray; } + + public int Task_64(int number) + { + if (number / 10 != 0) + return 1 + Task_64(number / 10); + return 1; + } + + public int Task_66(int M, int N) + { + if (N == M-1) + return 0; + return N + Task_66(M, N-1); + + } diff --git a/README.md b/README.md index 7a08b79..883cbdc 100644 --- a/README.md +++ b/README.md @@ -41,3 +41,8 @@ - [X] Task_54 - [X] Task_56 - [X] Task_62 + + +## HW9 +- [X] Task_64 +- [X] Task_66 diff --git a/Start.cs b/Start.cs index ed6c451..ab352d5 100644 --- a/Start.cs +++ b/Start.cs @@ -37,7 +37,7 @@ public class Start Tools myTools = new Tools(); Console.Write("Wich task: "); - Console.WriteLine("WH8 is 54, 56, 62"); + Console.WriteLine("WH9 is 64, 66"); // Console.WriteLine("WH3 is 19, 23"); int taskNumver = Convert.ToInt32(Console.ReadLine()); switch (taskNumver) @@ -175,6 +175,20 @@ public class Start int n = Convert.ToInt32(Console.ReadLine()); myTools.ShowInt2dArray(HW.Task_62(n)); break; + + case 64: + Console.WriteLine("Input number: "); + int number64 = Convert.ToInt32(Console.ReadLine()); + Console.WriteLine("Count numbers is: "+HW.Task_64(number64)); + break; + + case 66: + Console.WriteLine("Input M: "); + int M = Convert.ToInt32(Console.ReadLine()); + Console.WriteLine("Input N: "); + int N = Convert.ToInt32(Console.ReadLine()); + Console.WriteLine("Summ is: "+HW.Task_66(M, N)+ $" between numbers {M} and {N} "); + break; diff --git a/bin/Debug/net6.0/programming_GB.dll b/bin/Debug/net6.0/programming_GB.dll index 3d33734..910405e 100644 Binary files a/bin/Debug/net6.0/programming_GB.dll and b/bin/Debug/net6.0/programming_GB.dll differ diff --git a/bin/Debug/net6.0/programming_GB.pdb b/bin/Debug/net6.0/programming_GB.pdb index 7ae54a8..5758608 100644 Binary files a/bin/Debug/net6.0/programming_GB.pdb and b/bin/Debug/net6.0/programming_GB.pdb differ diff --git a/obj/Debug/net6.0/programming_GB.dll b/obj/Debug/net6.0/programming_GB.dll index 3d33734..910405e 100644 Binary files a/obj/Debug/net6.0/programming_GB.dll and b/obj/Debug/net6.0/programming_GB.dll differ diff --git a/obj/Debug/net6.0/programming_GB.pdb b/obj/Debug/net6.0/programming_GB.pdb index 7ae54a8..5758608 100644 Binary files a/obj/Debug/net6.0/programming_GB.pdb and b/obj/Debug/net6.0/programming_GB.pdb differ diff --git a/obj/Debug/net6.0/ref/programming_GB.dll b/obj/Debug/net6.0/ref/programming_GB.dll index 3f3b717..62a04fe 100644 Binary files a/obj/Debug/net6.0/ref/programming_GB.dll and b/obj/Debug/net6.0/ref/programming_GB.dll differ diff --git a/obj/Debug/net6.0/refint/programming_GB.dll b/obj/Debug/net6.0/refint/programming_GB.dll index 3f3b717..62a04fe 100644 Binary files a/obj/Debug/net6.0/refint/programming_GB.dll and b/obj/Debug/net6.0/refint/programming_GB.dll differ