From 98fd4db6cef8168fb59a274aef9c94e85f1eed8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9=20=D0=A7=D1=91?= =?UTF-8?q?=D1=80=D0=BD=D1=8B=D0=B9?= Date: Tue, 19 Sep 2023 18:07:38 +0300 Subject: [PATCH 01/26] task01 --- Seminars/Seminar01/Self/Task01/Program.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Seminars/Seminar01/Self/Task01/Program.cs b/Seminars/Seminar01/Self/Task01/Program.cs index 3671ed6..1d3616e 100644 --- a/Seminars/Seminar01/Self/Task01/Program.cs +++ b/Seminars/Seminar01/Self/Task01/Program.cs @@ -1 +1,15 @@ // Your code here! +using System; +class Program +{ + static void Main() + { + string firstname = Console.ReadLine(); + string lastname= Console.ReadLine(); + string secondname = Console.ReadLine(); + + Console.WriteLine($"Фамилия: {firstname}"); + Console.WriteLine($"Имя: {lastname}"); + Console.WriteLine($"Отчество: {secondname}"); + } +} \ No newline at end of file From 9b9a9457bd5ebe71efe15087b8ad8355e1a53362 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9=20=D0=A7=D1=91?= =?UTF-8?q?=D1=80=D0=BD=D1=8B=D0=B9?= Date: Tue, 19 Sep 2023 18:08:06 +0300 Subject: [PATCH 02/26] task02 --- Seminars/Seminar01/Self/Task02/Program.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Seminars/Seminar01/Self/Task02/Program.cs b/Seminars/Seminar01/Self/Task02/Program.cs index 3671ed6..8700f49 100644 --- a/Seminars/Seminar01/Self/Task02/Program.cs +++ b/Seminars/Seminar01/Self/Task02/Program.cs @@ -1 +1,13 @@ // Your code here! +using System; +class Program +{ + static void Main() + { + string firstname = Console.ReadLine(); + string lastname= Console.ReadLine(); + string secondname = Console.ReadLine(); + + Console.WriteLine($"{firstname} {lastname} {secondname}"); + } +} \ No newline at end of file From 225aad71a6cb80fd16eb42f248844a0cc2c286c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9=20=D0=A7=D1=91?= =?UTF-8?q?=D1=80=D0=BD=D1=8B=D0=B9?= Date: Tue, 19 Sep 2023 18:08:56 +0300 Subject: [PATCH 03/26] task03 --- Seminars/Seminar01/Self/Task03/Program.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Seminars/Seminar01/Self/Task03/Program.cs b/Seminars/Seminar01/Self/Task03/Program.cs index 3671ed6..49dc3d4 100644 --- a/Seminars/Seminar01/Self/Task03/Program.cs +++ b/Seminars/Seminar01/Self/Task03/Program.cs @@ -1 +1,11 @@ // Your code here! +using System; +class Program +{ + static void Main() + { + string firstname = Console.ReadLine(); + + Console.WriteLine($"Привет, {firstname}!"); + } +} \ No newline at end of file From 4ad140b47bf4cd51940c9615e6392c5a5b1d5516 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9=20=D0=A7=D1=91?= =?UTF-8?q?=D1=80=D0=BD=D1=8B=D0=B9?= Date: Tue, 19 Sep 2023 18:09:37 +0300 Subject: [PATCH 04/26] task04 --- Seminars/Seminar01/Self/Task04/Program.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Seminars/Seminar01/Self/Task04/Program.cs b/Seminars/Seminar01/Self/Task04/Program.cs index 3671ed6..f86a957 100644 --- a/Seminars/Seminar01/Self/Task04/Program.cs +++ b/Seminars/Seminar01/Self/Task04/Program.cs @@ -1 +1,11 @@ // Your code here! +using System; +class Program +{ + static void Main() + { + Console.BackgroundColor = ConsoleColor.Green; + Console.ForegroundColor = ConsoleColor.Red; + Console.WriteLine("floppABOBA"); + } +} \ No newline at end of file From dbd1dca67c7e2321ad193b1a09b1043709b68fd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9=20=D0=A7=D1=91?= =?UTF-8?q?=D1=80=D0=BD=D1=8B=D0=B9?= Date: Tue, 19 Sep 2023 18:10:06 +0300 Subject: [PATCH 05/26] task05 --- Seminars/Seminar01/Self/Task05/Program.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Seminars/Seminar01/Self/Task05/Program.cs b/Seminars/Seminar01/Self/Task05/Program.cs index 3671ed6..68a1be6 100644 --- a/Seminars/Seminar01/Self/Task05/Program.cs +++ b/Seminars/Seminar01/Self/Task05/Program.cs @@ -1 +1,14 @@ // Your code here! +using System; +class Program +{ + static void Main() + { + float u = Convert.ToInt32(Console.ReadLine()); + float r = Convert.ToInt32(Console.ReadLine()); + float i = u / r; + float p = (u * u) / r; + Console.WriteLine("I = {0}", i); + Console.WriteLine("P = {0}", p); + } +} \ No newline at end of file From 1cc7f0e187de77abe71f2a00fa485f4466e817db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9=20=D0=A7=D1=91?= =?UTF-8?q?=D1=80=D0=BD=D1=8B=D0=B9?= Date: Tue, 19 Sep 2023 18:10:30 +0300 Subject: [PATCH 06/26] task06 --- Seminars/Seminar01/Self/Task06/Program.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Seminars/Seminar01/Self/Task06/Program.cs b/Seminars/Seminar01/Self/Task06/Program.cs index 83fa4f4..5cfacdc 100644 --- a/Seminars/Seminar01/Self/Task06/Program.cs +++ b/Seminars/Seminar01/Self/Task06/Program.cs @@ -1,2 +1,11 @@ -// See https://aka.ms/new-console-template for more information -Console.WriteLine("Hello, World!"); +using System; +class Program +{ + static void Main() + { + double a = Convert.ToDouble(Console.ReadLine()); + double b = Convert.ToDouble(Console.ReadLine()); + + Console.WriteLine(Math.Sqrt((a * a) + (b * b))); + } +} \ No newline at end of file From 6ce4ec81690b8b9c7ffdadceb30903414347a123 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9=20=D0=A7=D1=91?= =?UTF-8?q?=D1=80=D0=BD=D1=8B=D0=B9?= Date: Tue, 19 Sep 2023 18:12:49 +0300 Subject: [PATCH 07/26] task01 --- Seminars/Seminar04/Self/Task01/Program1.cs | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Seminars/Seminar04/Self/Task01/Program1.cs diff --git a/Seminars/Seminar04/Self/Task01/Program1.cs b/Seminars/Seminar04/Self/Task01/Program1.cs new file mode 100644 index 0000000..8abf6b1 --- /dev/null +++ b/Seminars/Seminar04/Self/Task01/Program1.cs @@ -0,0 +1,25 @@ +using System; +class Program1 +{ + static void Main() + { + string str = Console.ReadLine(); + char a = str[0]; + switch (a) + { + case >='0' and <='9': + Console.WriteLine($"{a} 100"); + break; + case >='A' and <='Z': + Console.WriteLine($"{a} 200"); + break; + case >='a' and <='z': + Console.WriteLine($"{a} 300"); + break; + + default: + Console.WriteLine($"{a} 400"); + break; + } + } +} \ No newline at end of file From 85db1d93ab29496c54fd626b683aa5c3f7645c3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9=20=D0=A7=D1=91?= =?UTF-8?q?=D1=80=D0=BD=D1=8B=D0=B9?= Date: Tue, 19 Sep 2023 18:13:34 +0300 Subject: [PATCH 08/26] task02 --- Seminars/Seminar04/Self/Task02/Program.cs | 52 +++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 Seminars/Seminar04/Self/Task02/Program.cs diff --git a/Seminars/Seminar04/Self/Task02/Program.cs b/Seminars/Seminar04/Self/Task02/Program.cs new file mode 100644 index 0000000..c99f3cd --- /dev/null +++ b/Seminars/Seminar04/Self/Task02/Program.cs @@ -0,0 +1,52 @@ +using System; +class Program +{ + static void Main(string[] args) + { + string str = Console.ReadLine(); + + switch (str) + { + case "January" or "Январь" or "january" or "январь": + Console.WriteLine("1"); + break; + case "February" or "Февраль" or "february" or "февраль": + Console.WriteLine("2"); + break; + case "March" or "Март" or "march" or "март": + Console.WriteLine("3"); + break; + case "April" or "Апрель" or "april" or "апрель": + Console.WriteLine("4"); + break; + case "May" or "Май" or "may" or "май": + Console.WriteLine("5"); + break; + case "June" or "Июнь" or "june" or "июнь": + Console.WriteLine("6"); + break; + case "July" or "Июль" or "july" or "июль": + Console.WriteLine("7"); + break; + case "August" or "Август" or "august" or "август": + Console.WriteLine("8"); + break; + case "September" or "Сентябрь" or "september" or "сентябрь": + Console.WriteLine("9"); + break; + case "October" or "Октябрь" or "october" or "октябрь": + Console.WriteLine("10"); + break; + case "November" or "Ноябрь" or "november" or "ноябрь": + Console.WriteLine("11"); + break; + case "December" or "Декабрь" or "december" or "декабрь": + Console.WriteLine("12"); + break; + + default: + Console.WriteLine("В году такой месяц отстутствует."); + break; + } + } +} \ No newline at end of file From ff25de61fdf2b2b66b71358aa2ab05129f90e4f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9=20=D0=A7=D1=91?= =?UTF-8?q?=D1=80=D0=BD=D1=8B=D0=B9?= Date: Tue, 19 Sep 2023 18:14:23 +0300 Subject: [PATCH 09/26] task03 --- Seminars/Seminar04/Self/Task03/Program.cs | 40 +++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Seminars/Seminar04/Self/Task03/Program.cs diff --git a/Seminars/Seminar04/Self/Task03/Program.cs b/Seminars/Seminar04/Self/Task03/Program.cs new file mode 100644 index 0000000..967d2b3 --- /dev/null +++ b/Seminars/Seminar04/Self/Task03/Program.cs @@ -0,0 +1,40 @@ +using System; +class Program +{ + public static void Main() + { + Console.Write("Введите код операции: "); + int x = Convert.ToInt32(Console.ReadLine()); + Console.Write("Введите A: "); + double a = Convert.ToDouble(Console.ReadLine()); + Console.Write("Введите B: "); + double b = Convert.ToDouble(Console.ReadLine()); + + if (b != 0 && x <= 4 && x >= 1) + { + switch (x) + { + case 1: + double s = a + b; + Console.WriteLine($"{a} + {b} = {s}"); + break; + + case 2: + double q = a - b; + Console.WriteLine($"{a} - {b} = {q}"); + break; + + case 3: + double p = a * b; + Console.WriteLine($"{a} * {b} = {p}"); + break; + + case 4: + double l = a / b; + Console.WriteLine($"{a} / {b} = {l}"); + break; + } + } + else {Console.WriteLine("Error!");} + } +} From 4c700c2198b3eb2476fbe799c63386c78bd86393 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9=20=D0=A7=D1=91?= =?UTF-8?q?=D1=80=D0=BD=D1=8B=D0=B9?= Date: Tue, 19 Sep 2023 18:15:26 +0300 Subject: [PATCH 10/26] task04 --- Seminars/Seminar04/Self/Task04/Program.cs | 55 +++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 Seminars/Seminar04/Self/Task04/Program.cs diff --git a/Seminars/Seminar04/Self/Task04/Program.cs b/Seminars/Seminar04/Self/Task04/Program.cs new file mode 100644 index 0000000..0eddd50 --- /dev/null +++ b/Seminars/Seminar04/Self/Task04/Program.cs @@ -0,0 +1,55 @@ +using System.Runtime.Serialization; +using System.Runtime.Intrinsics.X86; +using Microsoft.VisualBasic; +using System; +class Program +{ + static void Main(string[] args) + { + Console.Write("Ввод: "); + string str = Console.ReadLine(); + string[] strings = str.Split(' '); + if (strings.Length != 3) + { + Console.WriteLine("Переполнение"); + } + else + { + string a = strings[0]; + string b = strings[2]; + char op = Convert.ToChar(strings[1]); + + switch(op) + { + case '+': + double.TryParse(a, out double aa); + double.TryParse(b, out double bb); + Console.Write("Вывод: "); + Console.WriteLine(aa + bb); + break; + case '-': + double.TryParse(a, out double aaa); + double.TryParse(b, out double bbb); + Console.Write("Вывод: "); + Console.WriteLine(aaa - bbb); + break; + case '*': + double.TryParse(a, out double a1); + double.TryParse(b, out double b1); + Console.Write("Вывод: "); + Console.WriteLine(a1 * b1); + break; + case '/': + double.TryParse(a, out double a2); + double.TryParse(b, out double b2); + Console.Write("Вывод: "); + Console.WriteLine(a2 / b2); + break; + + default: + Console.WriteLine("Недопустимая операция"); + break; + } + } + } +} \ No newline at end of file From 984f6b1aa0455dd219f3f592ecb638f5e630d41c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9=20=D0=A7=D1=91?= =?UTF-8?q?=D1=80=D0=BD=D1=8B=D0=B9?= Date: Tue, 19 Sep 2023 18:33:25 +0300 Subject: [PATCH 11/26] task01 --- Seminars/Seminar03/Self/Task01/Program.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Seminars/Seminar03/Self/Task01/Program.cs diff --git a/Seminars/Seminar03/Self/Task01/Program.cs b/Seminars/Seminar03/Self/Task01/Program.cs new file mode 100644 index 0000000..a475c67 --- /dev/null +++ b/Seminars/Seminar03/Self/Task01/Program.cs @@ -0,0 +1,15 @@ +using System; +class Program +{ + public static void Main() + { + int n = Convert.ToInt32(Console.ReadLine()); + double.TryParse(Console.ReadLine(), out double l); + + if (1 <= n && n < 11 && n != 2 && l > 0 && Math.Tan(Math.PI / n) > 0) + { + double s = ((n * l) * (n * l)) / (4 * Math.Tan(Math.PI / n)); + Console.WriteLine(s); + } + } +} \ No newline at end of file From ae16718ebf9a871549632668d4abab7b3cffd4c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9=20=D0=A7=D1=91?= =?UTF-8?q?=D1=80=D0=BD=D1=8B=D0=B9?= Date: Tue, 19 Sep 2023 18:55:53 +0300 Subject: [PATCH 12/26] task04 --- Seminars/Seminar03/Self/Task04/Program.cs | 30 +++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Seminars/Seminar03/Self/Task04/Program.cs diff --git a/Seminars/Seminar03/Self/Task04/Program.cs b/Seminars/Seminar03/Self/Task04/Program.cs new file mode 100644 index 0000000..7097f2d --- /dev/null +++ b/Seminars/Seminar03/Self/Task04/Program.cs @@ -0,0 +1,30 @@ +using System; +class Program +{ + public static void Main() + { + double.TryParse(Console.ReadLine(), out double x); + double.TryParse(Console.ReadLine(), out double y); + Console.WriteLine(x); + Console.WriteLine(y); + + if (x < y) + { + double f1 = Math.Sin(x) + (Math.Cos(y) * Math.Cos(y)); + Console.WriteLine(f1); + } + else + { + if (x == y) + { + double f2 = Math.Log(x); + Console.WriteLine(f2); + } + else + { + double f3 = Math.Sin(x * x) + (Math.Cos(y)); + Console.WriteLine(f3); + } + } + } +} \ No newline at end of file From 803fd8f8880380e4f346477ef328c2b7647fae3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9=20=D0=A7=D1=91?= =?UTF-8?q?=D1=80=D0=BD=D1=8B=D0=B9?= Date: Tue, 19 Sep 2023 19:15:31 +0300 Subject: [PATCH 13/26] task05 --- Seminars/Seminar03/Self/Task05/Program.cs | 51 +++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 Seminars/Seminar03/Self/Task05/Program.cs diff --git a/Seminars/Seminar03/Self/Task05/Program.cs b/Seminars/Seminar03/Self/Task05/Program.cs new file mode 100644 index 0000000..39fd751 --- /dev/null +++ b/Seminars/Seminar03/Self/Task05/Program.cs @@ -0,0 +1,51 @@ +using System.Data; +using System; +class Program +{ + public static void Main() + { + double.TryParse(Console.ReadLine(), out double a); + double.TryParse(Console.ReadLine(), out double b); + double.TryParse(Console.ReadLine(), out double c); + + Console.WriteLine($"{a}x^2 + {b}x + {c}"); + + if (a == 0) + { + double x1 = -c / b; + Console.WriteLine($"x = {x1}"); + } + else + { + if (b == 0) + { + double x2 = Math.Sqrt(-c / a); + Console.WriteLine($"x1 = {x2}"); + Console.WriteLine($"x2 = -{x2}"); + } + else + { + double d = b * b - 4 * a * c; + if (d < 0) + { + Console.WriteLine("Нет действительных корней"); + } + else + { + if (d == 0) + { + double x3 = -b / (2 * a); + Console.WriteLine($"x = {x3}"); + } + else + { + double x4 = (-b + Math.Sqrt(d)) / (2 * a); + double x5 = (-b - Math.Sqrt(d)) / (2 * a); + Console.WriteLine($"x1 = {x4}"); + Console.WriteLine($"x2 = {x5}"); + } + } + } + } + } +} \ No newline at end of file From d333a172922358ceedf7010a6928558f4246815f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9=20=D0=A7=D1=91?= =?UTF-8?q?=D1=80=D0=BD=D1=8B=D0=B9?= Date: Tue, 19 Sep 2023 22:58:11 +0300 Subject: [PATCH 14/26] task02 --- Seminars/Seminar03/Self/Task02/Program.cs | 35 +++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Seminars/Seminar03/Self/Task02/Program.cs diff --git a/Seminars/Seminar03/Self/Task02/Program.cs b/Seminars/Seminar03/Self/Task02/Program.cs new file mode 100644 index 0000000..eb21179 --- /dev/null +++ b/Seminars/Seminar03/Self/Task02/Program.cs @@ -0,0 +1,35 @@ +using System; +class Aboba +{ + public static void Main() + { + double.TryParse(Console.ReadLine(), out double x); + double.TryParse(Console.ReadLine(), out double y); + string a = "Точка внутри области"; + string b = "Точка на границе области"; + string c = "Точка не принадлежит области"; + + if (y < 0) + { + Console.WriteLine(c); + } + else + { + if ((x * x + y * y) > 1 && (x * x + y * y) < 4) + { + Console.WriteLine(a); + } + else + { + if ((x * x + y * y) == 1 || (x * x + y * y) == 4) + { + Console.WriteLine(b); + } + else + { + Console.WriteLine(c); + } + } + } + } +} \ No newline at end of file From 667285c1daa117978912a219319fc780a6fe9102 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9=20=D0=A7=D1=91?= =?UTF-8?q?=D1=80=D0=BD=D1=8B=D0=B9?= Date: Tue, 19 Sep 2023 23:15:41 +0300 Subject: [PATCH 15/26] task03 --- Seminars/Seminar03/Self/Task03/Program.cs | 51 +++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 Seminars/Seminar03/Self/Task03/Program.cs diff --git a/Seminars/Seminar03/Self/Task03/Program.cs b/Seminars/Seminar03/Self/Task03/Program.cs new file mode 100644 index 0000000..bef10a8 --- /dev/null +++ b/Seminars/Seminar03/Self/Task03/Program.cs @@ -0,0 +1,51 @@ +using System; +class Program +{ + public static void Main() + { + double.TryParse(Console.ReadLine(), out double x); + double.TryParse(Console.ReadLine(), out double y); + + string a = "Точка внутри области"; + string b = "Точка на границе области"; + string c = "Точка не принадлежит области"; + + if (y < 0) + { + if (x * x + y * y < 1) + { + Console.WriteLine(a); + } + else + { + if (x * x + y * y == 1) + { + Console.WriteLine(b); + } + else + { + Console.WriteLine(c); + } + + } + } + else + { + if (x * x + y * y < 4) + { + Console.WriteLine(a); + } + else + { + if (x * x + y * y == 4) + { + Console.WriteLine(b); + } + else + { + Console.WriteLine(c); + } + } + } + } +} From 8d5683a79df52d84e5c43b19e4e2ecc27eb2edb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9=20=D0=A7=D1=91?= =?UTF-8?q?=D1=80=D0=BD=D1=8B=D0=B9?= Date: Wed, 27 Sep 2023 16:51:47 +0300 Subject: [PATCH 16/26] self01 --- Seminars/Seminar06/Self/Self01/Program.cs | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/Seminars/Seminar06/Self/Self01/Program.cs b/Seminars/Seminar06/Self/Self01/Program.cs index db1541a..afee6a7 100644 --- a/Seminars/Seminar06/Self/Self01/Program.cs +++ b/Seminars/Seminar06/Self/Self01/Program.cs @@ -1 +1,19 @@ -// Ваше решение. +using System; +class Program +{ + public static void Main() + { + bool p = false; + bool q = false; + do + { + do + { + bool F = !(p & q) & !(p | !q); + Console.WriteLine($"p = {p} q = {q} F = {F}"); + q = !q; + } while (q); + p = !p; + } while (p); + } +} From 9ddbc485ddf2e9e491b06d1304797a9f3dc2129b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9=20=D0=A7=D1=91?= =?UTF-8?q?=D1=80=D0=BD=D1=8B=D0=B9?= Date: Wed, 4 Oct 2023 12:17:33 +0300 Subject: [PATCH 17/26] self02 --- Seminars/Seminar05/Self/Self02/Program.cs | 35 ++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/Seminars/Seminar05/Self/Self02/Program.cs b/Seminars/Seminar05/Self/Self02/Program.cs index db1541a..238f104 100644 --- a/Seminars/Seminar05/Self/Self02/Program.cs +++ b/Seminars/Seminar05/Self/Self02/Program.cs @@ -1 +1,34 @@ -// Ваше решение. +using System; +// Ваше решение. +class Program +{ + static void Main(string[] args) + { + int count_int = 0; + int count_double = 0; + int count_oth = 0; + + string s = Console.ReadLine(); + do + { + int.TryParse(s, out int a); + double.TryParse(s, out double b); + if (a != 0 || s == "0") + { + count_int += 1; + } + else if (b != 0) + { + count_double += 1; + } + else + { + count_oth += 1; + } + s = Console.ReadLine(); + } while (s != "0"); + Console.WriteLine($"Количество int: {count_int}"); + Console.WriteLine($"Количество double: {count_double}"); + Console.WriteLine($"Количество нечисловых: {count_oth}"); + } +} \ No newline at end of file From 40061d57332670952cb342cd01d7410825f35456 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9=20=D0=A7=D1=91?= =?UTF-8?q?=D1=80=D0=BD=D1=8B=D0=B9?= Date: Wed, 4 Oct 2023 15:20:23 +0300 Subject: [PATCH 18/26] self03 --- Seminars/Seminar05/Self/Self03/Program.cs | 24 +++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Seminars/Seminar05/Self/Self03/Program.cs b/Seminars/Seminar05/Self/Self03/Program.cs index db1541a..7137e39 100644 --- a/Seminars/Seminar05/Self/Self03/Program.cs +++ b/Seminars/Seminar05/Self/Self03/Program.cs @@ -1 +1,25 @@ // Ваше решение. +using System; +class Program +{ + public static void Main() + { + double.TryParse(Console.ReadLine(), out double a); + int.TryParse(Console.ReadLine(), out int n); + double summa_pr = 0; + double x = 0; + double x1 = 0; + double y1 = 0; + double plus = a / n; + + while (x < a) + { + x1 += plus; + y1 = x1 * x1; + summa_pr += (x1 - x) * y1; + x += plus; + } + + Console.WriteLine($"Площадь: {summa_pr}"); + } +} \ No newline at end of file From 7e6faccd2917f5eda03e0e539fc8320cbd1eb20b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9=20=D0=A7=D1=91?= =?UTF-8?q?=D1=80=D0=BD=D1=8B=D0=B9?= Date: Wed, 4 Oct 2023 15:58:57 +0300 Subject: [PATCH 19/26] self04 --- Seminars/Seminar05/Self/Self04/Program.cs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Seminars/Seminar05/Self/Self04/Program.cs b/Seminars/Seminar05/Self/Self04/Program.cs index db1541a..884a184 100644 --- a/Seminars/Seminar05/Self/Self04/Program.cs +++ b/Seminars/Seminar05/Self/Self04/Program.cs @@ -1 +1,22 @@ // Ваше решение. +using System; +class Program +{ + public static void Main() + { + double a = 1; + double b = 2; + double c = 3; + double summa = 0; + double current = 1 / (a * b * c); + while (current > double.Epsilon) + { + summa += current; + a += 1; + b += 1; + c += 1; + current = 1 / (a * b * c); + } + Console.WriteLine(summa); + } +} \ No newline at end of file From 1ba37840b5ccc2c870a1352100834050674fca5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9=20=D0=A7=D1=91?= =?UTF-8?q?=D1=80=D0=BD=D1=8B=D0=B9?= Date: Wed, 4 Oct 2023 16:36:56 +0300 Subject: [PATCH 20/26] self05 --- Seminars/Seminar05/Self/Self05/Program.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Seminars/Seminar05/Self/Self05/Program.cs b/Seminars/Seminar05/Self/Self05/Program.cs index db1541a..1ada9e5 100644 --- a/Seminars/Seminar05/Self/Self05/Program.cs +++ b/Seminars/Seminar05/Self/Self05/Program.cs @@ -1 +1,19 @@ // Ваше решение. +using System; +class Program +{ + public static void Main() + { + int.TryParse(Console.ReadLine(), out int k); + int k1 = 1; + double summa = 0; + while (k1 <= k) + { + summa += 1.0 / k1; + k1 += 1; + } + string s = string.Format("{0:F4}", summa); + Console.WriteLine(s); + + } +} \ No newline at end of file From f33f5bb6172bc06a1395ed03d1122521d464b3d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9=20=D0=A7=D1=91?= =?UTF-8?q?=D1=80=D0=BD=D1=8B=D0=B9?= Date: Wed, 4 Oct 2023 16:44:43 +0300 Subject: [PATCH 21/26] self06 --- Seminars/Seminar05/Self/Self06/Program.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Seminars/Seminar05/Self/Self06/Program.cs b/Seminars/Seminar05/Self/Self06/Program.cs index db1541a..f0ef430 100644 --- a/Seminars/Seminar05/Self/Self06/Program.cs +++ b/Seminars/Seminar05/Self/Self06/Program.cs @@ -1 +1,14 @@ // Ваше решение. +using System; +class Program +{ + public static void Main() + { + int n = 111; + while (n <= 999) + { + Console.WriteLine(n); + n += 111; + } + } +} \ No newline at end of file From 5fbd917220b0b0c96b5680046773308633a0872a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9=20=D0=A7=D1=91?= =?UTF-8?q?=D1=80=D0=BD=D1=8B=D0=B9?= Date: Wed, 4 Oct 2023 17:07:29 +0300 Subject: [PATCH 22/26] self07 --- Seminars/Seminar05/Self/Self07/Program.cs | 27 +++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Seminars/Seminar05/Self/Self07/Program.cs b/Seminars/Seminar05/Self/Self07/Program.cs index db1541a..73efb9a 100644 --- a/Seminars/Seminar05/Self/Self07/Program.cs +++ b/Seminars/Seminar05/Self/Self07/Program.cs @@ -1 +1,28 @@ // Ваше решение. +using System; +class Program +{ + public static void Main() + { + int.TryParse(Console.ReadLine(), out int n); + string str_n = Convert.ToString(n); + int i = str_n.Length - 1; + bool f = false; + string new_s = ""; + while (i >= 0) + { + if (str_n[i] == '0' && f == false) + { + i -= 1; + continue; + } + else + { + f = true; + new_s += str_n[i]; + } + i -= 1; + } + Console.WriteLine($"{n} -> {new_s}"); + } +} \ No newline at end of file From 97b8af6746104e41fb46392a6747df9f98fbeeea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9=20=D0=A7=D1=91?= =?UTF-8?q?=D1=80=D0=BD=D1=8B=D0=B9?= Date: Wed, 4 Oct 2023 17:26:34 +0300 Subject: [PATCH 23/26] self08 --- Seminars/Seminar05/Self/Self08/Program.cs | 36 +++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/Seminars/Seminar05/Self/Self08/Program.cs b/Seminars/Seminar05/Self/Self08/Program.cs index db1541a..e6953ff 100644 --- a/Seminars/Seminar05/Self/Self08/Program.cs +++ b/Seminars/Seminar05/Self/Self08/Program.cs @@ -1 +1,37 @@ // Ваше решение. +using System; +class Program +{ + public static void Main() + { + int.TryParse(Console.ReadLine(), out int n); + int.TryParse(Console.ReadLine(), out int k); + string str_n = Convert.ToString(n); + string answer = ""; + if (k == 0 || k > str_n.Length) + { + while (k == 0 || k > str_n.Length) + { + Console.WriteLine("Некорректный ввод K!"); + k = int.Parse(Console.ReadLine()); + } + int i = 0; + while (i < k) + { + answer += str_n[i]; + i += 1; + } + Console.WriteLine(answer); + } + else + { + int i = 0; + while (i < k) + { + answer += str_n[i]; + i += 1; + } + Console.WriteLine(answer); + } + } +} \ No newline at end of file From f5aef5911c5e25cccd6a7a388c138adf2e2dba9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9=20=D0=A7=D1=91?= =?UTF-8?q?=D1=80=D0=BD=D1=8B=D0=B9?= Date: Wed, 4 Oct 2023 18:02:44 +0300 Subject: [PATCH 24/26] self09 --- Seminars/Seminar05/Self/Self09/Program.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Seminars/Seminar05/Self/Self09/Program.cs b/Seminars/Seminar05/Self/Self09/Program.cs index db1541a..2dee94a 100644 --- a/Seminars/Seminar05/Self/Self09/Program.cs +++ b/Seminars/Seminar05/Self/Self09/Program.cs @@ -1 +1,19 @@ // Ваше решение. +using System; +class Program +{ + public static void Main() + { + double.TryParse(Console.ReadLine(), out double x); + double.TryParse(Console.ReadLine(), out double y); + + if (((x * x + y * y <= 4) && (y <= 0.5 * x) && (y >= 0)) || ((x * x + y * y <= 4) && (y <= 0) && (x >= 0))) + { + Console.WriteLine("true"); + } + else + { + Console.WriteLine("false"); + } + } +} \ No newline at end of file From 6845af5bdca1b04407b0243f2af3d2209047a926 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9=20=D0=A7=D1=91?= =?UTF-8?q?=D1=80=D0=BD=D1=8B=D0=B9?= Date: Thu, 5 Oct 2023 11:46:24 +0300 Subject: [PATCH 25/26] self02 --- Seminars/Seminar06/Self/Self02/Program.cs | 26 ++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/Seminars/Seminar06/Self/Self02/Program.cs b/Seminars/Seminar06/Self/Self02/Program.cs index db1541a..a98b8ea 100644 --- a/Seminars/Seminar06/Self/Self02/Program.cs +++ b/Seminars/Seminar06/Self/Self02/Program.cs @@ -1 +1,25 @@ -// Ваше решение. +using System; +class Program +{ + public static void Main() + { + bool a = false; + bool b = false; + bool c = false; + Console.WriteLine("a\tb\tc\tF"); + do + { + do + { + do + { + bool F = !(a || b && c) || a; + Console.WriteLine($"{a}\t{b}\t{c}\t{F}"); + c = !c; + } while (c); + b = !b; + } while (b); + a = !a; + } while (a); + } +} \ No newline at end of file From e08e1848fcaf05d24861bf8faaf21888b5f5d7bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9=20=D0=A7=D1=91?= =?UTF-8?q?=D1=80=D0=BD=D1=8B=D0=B9?= Date: Thu, 5 Oct 2023 12:18:25 +0300 Subject: [PATCH 26/26] self03 --- Seminars/Seminar06/Self/Self03/Program.cs | 43 ++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/Seminars/Seminar06/Self/Self03/Program.cs b/Seminars/Seminar06/Self/Self03/Program.cs index db1541a..a2cff72 100644 --- a/Seminars/Seminar06/Self/Self03/Program.cs +++ b/Seminars/Seminar06/Self/Self03/Program.cs @@ -1 +1,42 @@ -// Ваше решение. +using System; +class Program +{ + public static void Main() + { + int n1 = 2000; + int n2 = 3000; + string n_str; + + while (n1 <= n2) + { + n_str = Convert.ToString(n1); + int count = 1; + bool f = true; + for (int i = 0; i < n_str.Length; i++) + { + for (int j = 0; j < n_str.Length; j++) + { + if (i != j) + { + if (n_str[i] == n_str[j]) + { + count += 1; + } + } + } + if (count == 2) + { + f = false; + break; + } + count = 1; + } + if (f) + { + Console.WriteLine(n1); + } + + n1 += 1; + } + } +} \ No newline at end of file