From 191a44dd5f355d6589e949b03e48e6148cce5176 Mon Sep 17 00:00:00 2001 From: Mark <112826355+NemirovichMark@users.noreply.github.com> Date: Thu, 2 Oct 2025 14:14:53 +0300 Subject: [PATCH 1/3] Update Program.cs --- Lab3/Program.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Lab3/Program.cs b/Lab3/Program.cs index 4081ed2..1e36c79 100644 --- a/Lab3/Program.cs +++ b/Lab3/Program.cs @@ -69,11 +69,11 @@ private static void TestGreen() // Console.WriteLine($"Task1 test 2. Paste 4 inputs"); // Console.WriteLine($"Task1 test 2 {green.Task1(1, 1, 2, 2) == 2}"); // Console.WriteLine($"Task1 test 3. Paste 10 inputs"); - // Console.WriteLine($"Task1 test 3 {green.Task1(1, 1, 2, 5) == 4}"); + // Console.WriteLine($"Task1 test 3 {green.Task1(1, 1, 3, 5) == 4}"); // Console.WriteLine($"Task1 test 4. Paste 20 inputs"); - // Console.WriteLine($"Task1 test 4 {green.Task1(1, 2, 1, 10) == 1}"); + // Console.WriteLine($"Task1 test 4 {green.Task1(1, 1, 2, 5) == 2}"); // Console.WriteLine($"Task1 test 5. Paste 20 inputs"); - // Console.WriteLine($"Task1 test 5 {green.Task1(0, 1, 1, 10) == 6}"); + // Console.WriteLine($"Task1 test 5 {green.Task1(0, 1, 2, 10) == 7}"); // Console.WriteLine($"Task2 test 1 {green.Task2(0) == (0, 0)}"); // Console.WriteLine($"Task2 test 2. Paste 2 inputs"); @@ -190,3 +190,4 @@ private static void TestPurple() } } } + From 3db9c2fca984d48e192b6e129cf75a76558765dc Mon Sep 17 00:00:00 2001 From: Mark <112826355+NemirovichMark@users.noreply.github.com> Date: Sun, 5 Oct 2025 10:50:59 +0300 Subject: [PATCH 2/3] Update Program.cs --- Lab3/Program.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lab3/Program.cs b/Lab3/Program.cs index 1e36c79..bbfa030 100644 --- a/Lab3/Program.cs +++ b/Lab3/Program.cs @@ -70,7 +70,7 @@ private static void TestGreen() // Console.WriteLine($"Task1 test 2 {green.Task1(1, 1, 2, 2) == 2}"); // Console.WriteLine($"Task1 test 3. Paste 10 inputs"); // Console.WriteLine($"Task1 test 3 {green.Task1(1, 1, 3, 5) == 4}"); - // Console.WriteLine($"Task1 test 4. Paste 20 inputs"); + // Console.WriteLine($"Task1 test 4. Paste 10 inputs"); // Console.WriteLine($"Task1 test 4 {green.Task1(1, 1, 2, 5) == 2}"); // Console.WriteLine($"Task1 test 5. Paste 20 inputs"); // Console.WriteLine($"Task1 test 5 {green.Task1(0, 1, 2, 10) == 7}"); @@ -191,3 +191,4 @@ private static void TestPurple() } } + From eee7ef1dacfd295040a74732898cd322261ceaa2 Mon Sep 17 00:00:00 2001 From: Ezequiel Alejandro Zapata <157446504+Ezequiel-A-Zapata@users.noreply.github.com> Date: Sun, 19 Oct 2025 10:55:39 +0300 Subject: [PATCH 3/3] Update0 Blue.cs --- Lab3/Blue.cs | 161 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 158 insertions(+), 3 deletions(-) diff --git a/Lab3/Blue.cs b/Lab3/Blue.cs index 05d4560..e62e883 100644 --- a/Lab3/Blue.cs +++ b/Lab3/Blue.cs @@ -1,4 +1,61 @@ -namespace Lab3 +// namespace Lab3 +// { +// public class Blue +// { +// public double Task1(int n, int glass, int norma) +// { +// double milk = 0; + +// // code here + +// // end + +// return milk; +// } +// public (int first, int second, int third, int fourth) Task2(int n) +// { +// int first = 0, second = 0, third = 0, fourth = 0; + +// // code here + +// // end + +// return (first, second, third, fourth); +// } +// public int Task3(int n) +// { +// int count = 0; + +// // code here + +// // end + +// return count; +// } +// public (int tasks, int serias) Task4(int time, int tasks) +// { +// int serias = 0; + +// // code here + +// // end + +// return (tasks, serias); +// } +// public (int power, int agility, int intellect) Task5(int power, int agility, int intellect, int number) +// { + +// // code here + +// // end + +// return (power, agility, intellect); +// } +// } + +// } + +namespace Lab3 { public class Blue { @@ -7,17 +64,45 @@ public double Task1(int n, int glass, int norma) double milk = 0; // code here + + for (int i = 0; i < n; i++) + { + Console.Write($"Введите вес ученика {i + 1}: "); // "Ingrese el peso del alumno" + int weight = int.Parse(Console.ReadLine()); + + if (weight < norma) + { + milk += glass; // sumar un vaso + } + } + double totalMilkLiters = milk / 1000.0; // convertir a litros // end - return milk; + return totalMilkLiters; } public (int first, int second, int third, int fourth) Task2(int n) { int first = 0, second = 0, third = 0, fourth = 0; // code here + for (int i = 0; i < n; i++) + { + Console.Write($"Введите координаты точки {i + 1} (x y): "); // "Ingrese coordenadas" + string[] input = Console.ReadLine().Split(' '); + int x = int.Parse(input[0]); + int y = int.Parse(input[1]); + if (x > 0 && y > 0) + first++; + else if (x < 0 && y > 0) + second++; + else if (x < 0 && y < 0) + third++; + else if (x > 0 && y < 0) + fourth++; + // Si x == 0 o y == 0 → no cuenta + } // end return (first, second, third, fourth); @@ -27,7 +112,26 @@ public int Task3(int n) int count = 0; // code here + for (int i = 0; i < n; i++) + { + bool hasBadGrade = false; // para marcar si tiene 2 o 3 + + Console.WriteLine($"Введите 4 оценки студента {i + 1}: "); // "Ingrese 4 notas del estudiante" + for (int j = 0; j < 4; j++) + { + int grade = int.Parse(Console.ReadLine()); + if (grade == 2 || grade == 3) + { + hasBadGrade = true; // ya no cuenta este estudiante + } + } + + if (!hasBadGrade) + { + count++; // suma solo si NO tenía 2 o 3 + } + } // end return count; @@ -37,6 +141,24 @@ public int Task3(int n) int serias = 0; // code here + int taskTime = 10; + + while (time < 24 * 60) // hasta las 24:00 + { + if (tasks > 0) + { + time += taskTime; // hacer una tarea + taskTime += 5; // la siguiente tarea tarda 5 min más + tasks--; + } + else + { + Console.Write("Введите длительность серии (мин): "); // duración de la serie + int seriasTime = int.Parse(Console.ReadLine()); + time += seriasTime; // ver un capítulo + serias++; + } + } // end @@ -46,10 +168,43 @@ public int Task3(int n) { // code here + switch (number) + { + case 1: + power += 10; + intellect -= 5; // 1–3 bajan intelecto en 5 + break; + + case 2: + agility += 5; + power -= 5; // 2 y 5 bajan fuerza en 5 + intellect -= 5; // 1–3 bajan intelecto en 5 + break; + + case 3: + power += 10; + intellect -= 5; // 1–3 bajan intelecto en 5 + break; + + case 4: + agility += 15; + power -= 10; // 4 baja fuerza e intelecto en 10 + intellect -= 10; + break; + + case 5: + intellect += 7; + power -= 5; // 2 y 5 bajan fuerza en 5 + break; + } + // Clampeo a mínimo 0 + power = Math.Max(0, power); + agility = Math.Max(0, agility); + intellect = Math.Max(0, intellect); // end return (power, agility, intellect); } } -} \ No newline at end of file +}