Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp7
- {
- class Program
- {
- static void Main(string[] args)
- {
- bool access = false;
- int Age;
- Console.WriteLine("Здравствуйте, для прохода назовите свой возраст.");
- Console.Write("Мне ");
- Age = Convert.ToInt32(Console.ReadLine());
- if(Age >= 18 && Age <= 80)
- {
- Console.WriteLine("Проходи");
- access = true;
- }
- if(Age > 80)
- {
- Console.WriteLine("Дедуля вам сюда нельзя");
- access = false;
- }
- if(Age <= 3)
- {
- Console.WriteLine("Иди гуляй, шутник.");
- access = false;
- }
- if(Age > 3 && Age < 18)
- {
- Console.WriteLine("Подрости и возвращайся.");
- access = false;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement