Advertisement
nevenailievaa

09. Fruit or Vegetable

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