Yachkov

Personal TItles

Jan 24th, 2021 (edited)
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.95 KB | None | 0 0
  1. using System;
  2. using System.ComponentModel.Design;
  3. using System.Globalization;
  4. using System.Reflection;
  5. using System.Security.Cryptography;
  6.  
  7. namespace SomeExcercises
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             double age = double.Parse(Console.ReadLine());
  14.             string gender = Console.ReadLine();
  15.  
  16.             if (gender == "m")
  17.             {
  18.                 if (age >= 16)
  19.                 {
  20.                     Console.WriteLine("Mr.");
  21.                 }
  22.                 else
  23.                 {
  24.                     Console.WriteLine("Master");
  25.                 }
  26.             }
  27.  
  28.             if (gender == "f")
  29.             {
  30.                 if (age >= 16)
  31.                 {
  32.                     Console.WriteLine("Ms.");
  33.                 }
  34.                 else
  35.                 {
  36.                     Console.WriteLine("Miss");
  37.                 }
  38.             }
  39.  
  40.         }
  41.  
  42.     }
  43. }
  44.  
  45.  
  46.  
  47.  
Add Comment
Please, Sign In to add comment