Загрузить файлы в «works/lab03»

This commit is contained in:
2026-10-01 07:58:51 +00:00
parent 9f75c257fc
commit 0055c543e9
2 changed files with 80 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
namespace DefaultNamespace;
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("Вы начали бой!");
}
}
}