diff --git a/HomeWork.cs b/HomeWork.cs new file mode 100644 index 0000000..eaa4519 --- /dev/null +++ b/HomeWork.cs @@ -0,0 +1,72 @@ +namespace pr +{ + class HomeWork + { + + + public void First_task() + { + Console.Write("Input first number: "); + int a = Convert.ToInt32(Console.ReadLine()); + Console.Write("Input second number: "); + int b = Convert.ToInt32(Console.ReadLine()); + + if (a > b) + Console.WriteLine("Max is: " + a); + else + Console.WriteLine("Max is: " + b); + } + + public void Second_task() + { + int max; + + Console.Write("Input first number: "); + int a = Convert.ToInt32(Console.ReadLine()); + Console.Write("Input second number: "); + int b = Convert.ToInt32(Console.ReadLine()); + Console.Write("Input third number: "); + int c = Convert.ToInt32(Console.ReadLine()); + + /// use standart System.Math + // Console.WriteLine("Max is: " + Math.Max(a, Math.Max(b, c))); + + max = b > a ? b : a; + max = max > c ? max : c; + Console.WriteLine("Max is: " + max); + + } + + public void Third_task() + { + Console.Write("Input number for check even: "); + int inputNumber = Convert.ToInt32(Console.ReadLine()); + + if (inputNumber % 2 == 0) + Console.WriteLine("Even"); + + else + Console.WriteLine("Not even"); + + } + + public void Foth_task() + { + int current = 1; + Console.Write("Input number: "); + int numberTask4 = Convert.ToInt32(Console.ReadLine()); + + while (current <= numberTask4) + { + if (current % 2 == 0) + Console.WriteLine(current); + current++; + } + + + } + + + + } +} \ No newline at end of file diff --git a/Program.cs b/Program.cs deleted file mode 100644 index c436f55..0000000 --- a/Program.cs +++ /dev/null @@ -1,93 +0,0 @@ - -Main(); - -static void Main(){ - Console.Write("Wich task: "); - int taskNumver = Convert.ToInt32(Console.ReadLine()); - switch (taskNumver) - { - case 1: - First_task(); - break; - case 2: - Second_task(); - break; - - case 3: - Third_task(); - break; - - case 4: - Foth_task(); - break; - - default: - Console.WriteLine("Wrong task"); - break; - } - - -} - -static void First_task() -{ - Console.Write("Input first number: "); - int a = Convert.ToInt32(Console.ReadLine()); - Console.Write("Input second number: "); - int b = Convert.ToInt32(Console.ReadLine()); - - if (a > b) - Console.WriteLine("Max is: " + a); - else - Console.WriteLine("Max is: " + b); -} - -static void Second_task() -{ - int max; - - Console.Write("Input first number: "); - int a = Convert.ToInt32(Console.ReadLine()); - Console.Write("Input second number: "); - int b = Convert.ToInt32(Console.ReadLine()); - Console.Write("Input third number: "); - int c = Convert.ToInt32(Console.ReadLine()); - - /// use standart System.Math - // Console.WriteLine("Max is: " + Math.Max(a, Math.Max(b, c))); - - max = b > a ? b : a; - max = max > c ? max : c; - Console.WriteLine("Max is: " + max); - -} - -static void Third_task() -{ - Console.Write("Input number for check even: "); - int inputNumber = Convert.ToInt32(Console.ReadLine()); - - if (inputNumber%2 == 0) - Console.WriteLine("Even"); - - else - Console.WriteLine("Not even"); - -} - -static void Foth_task() -{ - int current = 1; - Console.Write("Input number: "); - int numberTask4 = Convert.ToInt32(Console.ReadLine()); - - while (current<= numberTask4) - { - if (current%2 == 0) - Console.WriteLine(current); - current++; - } - - -} - diff --git a/Start.cs b/Start.cs new file mode 100644 index 0000000..5f87ac4 --- /dev/null +++ b/Start.cs @@ -0,0 +1,88 @@ +namespace pr; + +public class Start +{ + static void Main() + { + Console.Write("HW or Practic: "); + int taskNumver = Convert.ToInt32(Console.ReadLine()); + switch (taskNumver) + { + case 1: + MyTask(); + break; + case 2: + PracticsTask(); + break; + + + } + } + + static void MyTask() + { + HomeWork HW = new HomeWork(); + + Console.Write("Wich task: "); + int taskNumver = Convert.ToInt32(Console.ReadLine()); + switch (taskNumver) + { + case 1: + HW.First_task(); + break; + case 2: + HW.Second_task(); + break; + + case 3: + HW.Third_task(); + break; + + case 4: + HW.Foth_task(); + break; + + + default: + Console.WriteLine("Wrong task"); + break; + } + + + } + + static void PracticsTask() + { + Practics pract = new Practics(); + + Console.Write("Wich task: "); + int taskNumver = Convert.ToInt32(Console.ReadLine()); + switch (taskNumver) + { + case 1: + pract.MaxNamber(); + break; + case 2: + int task2 = Convert.ToInt32(Console.ReadLine()); + pract.Second_task_1(task2); + break; + + case 3: + + break; + + case 4: + + break; + + + default: + Console.WriteLine("Wrong task"); + break; + } + + + } + + +} \ No newline at end of file diff --git a/bin/Debug/net6.0/programming_GB.dll b/bin/Debug/net6.0/programming_GB.dll index c2e25a7..5fbe574 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 38fadc9..2c74b60 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.csproj.CoreCompileInputs.cache b/obj/Debug/net6.0/programming_GB.csproj.CoreCompileInputs.cache index b9f9ca1..240b3d8 100644 --- a/obj/Debug/net6.0/programming_GB.csproj.CoreCompileInputs.cache +++ b/obj/Debug/net6.0/programming_GB.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -4726f62c8aecdfb151956f90c7e130fcb5d3f1d4 +1cea4dc6da66272d27938ece339a31c45c8e4364 diff --git a/obj/Debug/net6.0/programming_GB.dll b/obj/Debug/net6.0/programming_GB.dll index c2e25a7..5fbe574 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 38fadc9..2c74b60 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 7bbe20c..3a6e2ab 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 7bbe20c..3a6e2ab 100644 Binary files a/obj/Debug/net6.0/refint/programming_GB.dll and b/obj/Debug/net6.0/refint/programming_GB.dll differ