Garloon

2.1

Aug 23rd, 2019
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.87 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace CSLight
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int age;
  14.             bool IsDoorOpen;
  15.  
  16.             Console.WriteLine("Привет!");
  17.             Console.WriteLine("Сколько тебе лет?");
  18.             age = Convert.ToInt32(Console.ReadLine());
  19.             if(age >= 18)
  20.             {
  21.                 IsDoorOpen = true;
  22.             }
  23.             else
  24.             {
  25.                 IsDoorOpen = false;
  26.             }
  27.  
  28.             if (IsDoorOpen)
  29.             {
  30.                 Console.WriteLine("Заходи братишка!");
  31.             }
  32.             else
  33.             {
  34.                 Console.WriteLine("Иди учи уроки!");
  35.             }
  36.         }
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment