Advertisement
loleckek228

2.1

Aug 10th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.61 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _2._1
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             bool isDoorOpen = false;
  10.             Console.WriteLine("Сколько вам лет?");
  11.             int age = Convert.ToInt32(Console.ReadLine());
  12.             if (age >= 18)
  13.             {
  14.                 isDoorOpen = true;              
  15.             }
  16.             else
  17.             {
  18.                 isDoorOpen = false;
  19.             }
  20.             if (isDoorOpen)
  21.             {
  22.                 Console.WriteLine("Проходите");
  23.             }
  24.             else
  25.             {
  26.                 Console.WriteLine("Проход закрыт");
  27.             }
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement