This commit is contained in:
2022-07-27 20:24:57 +03:00
parent 76b33dab99
commit 0e8cd52097
9 changed files with 35 additions and 1 deletions
+15
View File
@@ -335,6 +335,21 @@
return snakeArray; 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);
}
+5
View File
@@ -41,3 +41,8 @@
- [X] Task_54 - [X] Task_54
- [X] Task_56 - [X] Task_56
- [X] Task_62 - [X] Task_62
## HW9
- [X] Task_64
- [X] Task_66
+15 -1
View File
@@ -37,7 +37,7 @@ public class Start
Tools myTools = new Tools(); Tools myTools = new Tools();
Console.Write("Wich task: "); Console.Write("Wich task: ");
Console.WriteLine("WH8 is 54, 56, 62"); Console.WriteLine("WH9 is 64, 66");
// Console.WriteLine("WH3 is 19, 23"); // Console.WriteLine("WH3 is 19, 23");
int taskNumver = Convert.ToInt32(Console.ReadLine()); int taskNumver = Convert.ToInt32(Console.ReadLine());
switch (taskNumver) switch (taskNumver)
@@ -175,6 +175,20 @@ public class Start
int n = Convert.ToInt32(Console.ReadLine()); int n = Convert.ToInt32(Console.ReadLine());
myTools.ShowInt2dArray(HW.Task_62(n)); myTools.ShowInt2dArray(HW.Task_62(n));
break; 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;
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.