This commit is contained in:
kosios.obsi
2026-09-10 10:59:47 +03:00
7 changed files with 24 additions and 21 deletions
@@ -24,7 +24,7 @@
"RelativeDocumentMoniker": "lab-03\\Program.cs", "RelativeDocumentMoniker": "lab-03\\Program.cs",
"ToolTip": "C:\\prog-radzh\\works\\Csharp\\lab-03\\lab-03\\Program.cs", "ToolTip": "C:\\prog-radzh\\works\\Csharp\\lab-03\\lab-03\\Program.cs",
"RelativeToolTip": "lab-03\\Program.cs", "RelativeToolTip": "lab-03\\Program.cs",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==", "ViewState": "AgIAAAAAAAAAAAAAAAAAACEAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2026-09-08T18:49:46.902Z", "WhenOpened": "2026-09-08T18:49:46.902Z",
"EditorCaption": "" "EditorCaption": ""
@@ -24,7 +24,7 @@
"RelativeDocumentMoniker": "lab-03\\Program.cs", "RelativeDocumentMoniker": "lab-03\\Program.cs",
"ToolTip": "C:\\prog-radzh\\works\\Csharp\\lab-03\\lab-03\\Program.cs", "ToolTip": "C:\\prog-radzh\\works\\Csharp\\lab-03\\lab-03\\Program.cs",
"RelativeToolTip": "lab-03\\Program.cs", "RelativeToolTip": "lab-03\\Program.cs",
"ViewState": "AgIAAAAAAAAAAAAAAAAAACEAAAAAAAAAAAAAAA==", "ViewState": "AgIAABsAAAAAAAAAAAAAACwAAAARAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2026-09-08T18:49:46.902Z", "WhenOpened": "2026-09-08T18:49:46.902Z",
"EditorCaption": "" "EditorCaption": ""
+22 -19
View File
@@ -19,26 +19,29 @@ Console.WriteLine($"{pokemon1Name} (HP: {pokemon1Hp} | Атака: {pokemon1Atta
*/ */
// task 2 // task 2
//int choice;
//Console.Write("Готовы начать бой? (1 - Да, 0 - Нет): ");
using System.ComponentModel.Design; //do
//{
// choice = int.Parse(Console.ReadLine());
// if (choice == 1)
// {
// Console.WriteLine("Вы начали бой!");
// }
int choice; // else if (choice == 0)
Console.Write("Готовы начать бой? (1 - Да, 0 - Нет): "); // {
// Console.WriteLine("Вы отменили бой!");
// }
// else
// {
// Console.WriteLine("Некорректная команда! Попробуйте снова.");
// }
//} while (choice != 1 && choice != 0);
// task 3
int pokemon1Attack = 12;
int pokemon2Hp =
do
{
choice = int.Parse(Console.ReadLine());
if (choice == 1)
{
Console.WriteLine("Вы начали бой!");
}
else if (choice == 0)
{
Console.WriteLine("Вы отменили бой!");
}
else
{
Console.WriteLine("Некорректная команда! Попробуйте снова.");
}
} while (choice != 1 && choice != 0);