Yachkov

Fruit or vegetable

Jan 24th, 2021 (edited)
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.82 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Exercise
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string product = Console.ReadLine();
  10.  
  11.  
  12.             switch (product)
  13.             {
  14.                 case "banana":
  15.                 case "kiwi":
  16.                 case "cherry":
  17.                 case "grapes":
  18.                 case "lemon":
  19.                 case "apple":
  20.                     Console.WriteLine("fruit");
  21.                     break;
  22.                 case "tomato":
  23.                 case "cucumber":
  24.                 case "pepper":
  25.                 case "carrot":
  26.                     Console.WriteLine("vegetable");
  27.                     break;
  28.                 default:
  29.                     Console.WriteLine("unknown");
  30.                     break;
  31.             }
  32.  
  33.  
  34.  
  35.         }
  36.     }
  37. }
  38.  
Add Comment
Please, Sign In to add comment