Advertisement
Qrist

Animal Type

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