This commit is contained in:
2026-09-09 10:22:36 +03:00
parent 494da37720
commit 38cc2263b4
+16 -5
View File
@@ -19,15 +19,26 @@ Console.WriteLine($"{pokemon1Name} (HP: {pokemon1Hp} | Атака: {pokemon1Atta
*/
// task 2
using System.ComponentModel.Design;
int choice;
Console.Write("Готовы начать бой? (1 - Да, 0 - Нет): ");
do
{
choice = int.Parse(Console.ReadLine());
Console.WriteLine("Некорректная команда! Попробуйте снова.");
} while (choice != 1 && choice != 0);
{
Console.WriteLine("Некорректная команда! Попробуйте снова.");
}
if (choice == 1)
{
Console.WriteLine("Вы начали бой!");
}
else if (choice == 0)
{
Console.WriteLine("Вы отменили бой!");
}
else
{
Console.WriteLine("Некорректная команда! Попробуйте снова.");
}
} while (choice != 1 && choice != 0);