Benjail

2.1

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