Advertisement
mastersan12

1.Ages - Basic

Mar 9th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.88 KB | None | 0 0
  1. using System;
  2.  
  3.  
  4. namespace _1._0
  5.     {
  6.         class Program
  7.         {
  8.             static void Main(string[] args)
  9.             {
  10.                 int ages = int.Parse(Console.ReadLine());
  11.  
  12.                 if (ages <= 2 && ages >= 0)
  13.                 {
  14.                     Console.WriteLine("baby");
  15.                 }
  16.                 else if (ages >= 3 && ages <= 13)
  17.                 {
  18.                     Console.WriteLine("child");
  19.  
  20.                 }
  21.                 else if (ages >= 14 && ages <= 19)
  22.                 {
  23.                     Console.WriteLine("teenager");
  24.                 }
  25.                 else if (ages >= 20 && ages <= 65)
  26.                 {
  27.                     Console.WriteLine("adult");
  28.                 }
  29.                 else if (ages >= 66)
  30.                 {
  31.                     Console.WriteLine("elder");
  32.                 }
  33.             }
  34.         }
  35.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement