M0Hk

AnimalType

Feb 25th, 2020
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.78 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _02.AnimalType
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string animal = Console.ReadLine();
  10.             switch (animal)
  11.             {
  12.                 case "dog":
  13.                     Console.WriteLine("mammal");
  14.                     break;
  15.                 case "crocodile":
  16.                     Console.WriteLine("reptile");
  17.                     break;
  18.                 case "tortoise":
  19.                     Console.WriteLine("reptile");
  20.                     break;
  21.                 case "snake":
  22.                     Console.WriteLine("reptile");
  23.                     break;
  24.                 default:
  25.                     Console.WriteLine("unknown");
  26.                     break;
  27.             }
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment