Загрузить файлы в «works/c/lab1.2»

This commit is contained in:
2026-09-21 12:57:18 +00:00
parent 22d0c69df8
commit 4dc1e8afaf
5 changed files with 139 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
public class ex2
{
static void Main(string[] args)
{
int choice;
do
{
Console.Write("Готовы начать бой? (1 - Да, 0 - Нет): ");
choice = int.Parse(Console.ReadLine());
if (choice != 1 && choice != 0)
{
Console.WriteLine("Некорректная команда! Попробуйте снова.");
}
} while (choice != 0 && choice != 1);
if (choice == 0)
{
Console.WriteLine("Вы отменили бой!");
}
if (choice == 1)
{
Console.WriteLine("Вы начали бой!");
}
}
}