generated from admin/template
Загрузить файлы в «works/c/lab1.2»
This commit is contained in:
@@ -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("Вы начали бой!");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user