anizko

01. Personal Titles

Apr 1st, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.86 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Условни_конструкции
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double Age = double.Parse(Console.ReadLine());
  10.             string Gender = Console.ReadLine();
  11.  
  12.             if (Gender == "m")
  13.             {
  14.                 if (Age >= 16)
  15.                 {
  16.                     Console.WriteLine("Mr.");
  17.                 }
  18.                 else
  19.                 {
  20.                     Console.WriteLine("Master");
  21.                 }
  22.             }
  23.             else if (Gender == "f")
  24.             {
  25.                 if (Age >= 16)
  26.                 {
  27.                     Console.WriteLine("Ms.");
  28.                 }
  29.                 else
  30.                 {
  31.                     Console.WriteLine("Miss");
  32.                 }
  33.  
  34.             }
  35.                
  36.         }
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment