Advertisement
PRO100LY4UK

2.1

Aug 17th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.12 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp7
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             bool access = false;
  10.            
  11.             int Age;
  12.  
  13.  
  14.  
  15.             Console.WriteLine("Здравствуйте, для прохода назовите свой возраст.");
  16.             Console.Write("Мне ");
  17.             Age = Convert.ToInt32(Console.ReadLine());
  18.  
  19.             if(Age >= 18 && Age <= 80)
  20.             {
  21.                 Console.WriteLine("Проходи");
  22.                 access = true;
  23.                
  24.             }
  25.             if(Age > 80)
  26.             {
  27.                 Console.WriteLine("Дедуля вам сюда нельзя");
  28.                 access = false;
  29.             }
  30.             if(Age <= 3)
  31.             {
  32.                 Console.WriteLine("Иди гуляй, шутник.");
  33.                 access = false;
  34.             }
  35.             if(Age > 3 && Age < 18)
  36.             {
  37.                 Console.WriteLine("Подрости и возвращайся.");
  38.                 access = false;
  39.             }
  40.  
  41.  
  42.            
  43.         }
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement