Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _2._1
- {
- class Program
- {
- static void Main(string[] args)
- {
- bool isDoorOpen = false;
- Console.WriteLine("Сколько вам лет?");
- int age = Convert.ToInt32(Console.ReadLine());
- if (age >= 18)
- {
- isDoorOpen = true;
- }
- else
- {
- isDoorOpen = false;
- }
- if (isDoorOpen)
- {
- Console.WriteLine("Проходите");
- }
- else
- {
- Console.WriteLine("Проход закрыт");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement