generated from admin/template
ex2
This commit is contained in:
@@ -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("Вы начали бой!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user