using System; namespace restless { class Visitor { private bool ticket; private int age; private int height; public void InputInfo() { c: Console.Write("Наличие билета: (Да/Нет): "); string t = Console.ReadLine().ToLower(); if (t == "да") ticket = true; else if (t == "нет") ticket = false; else { Console.WriteLine("Вы ввели что-то не то..."); goto c; } Console.Write("Ваш возраст: "); age = Convert.ToInt32(Console.ReadLine()); Console.Write("Ваш рост: "); height = Convert.ToInt32(Console.ReadLine()); } public bool CheckPeople() { if (ticket == true && age > 15 && height > 120) return true; return false; } } class Program { static void Main(string[] args) { Visitor ch1 = new Visitor(); ch1.InputInfo(); if (ch1.CheckPeople()) Console.WriteLine("Вам можно пройти!"); else Console.WriteLine("Увы, но пройти Вам нельзя!"); } } }