Advertisement
knikolov98

Untitled

Sep 17th, 2019
172
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 Fruit_or_vegetable
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string input = Console.ReadLine();
  10.  
  11.             switch (input)
  12.             {
  13.                 case "banana":
  14.                 case "apple":
  15.                 case "kiwi":
  16.                 case "cherry":
  17.                 case "lemon":
  18.                 case "grapes":
  19.                     Console.WriteLine("fruit");
  20.                     break;
  21.  
  22.                 case "tomato":
  23.                 case "cucumber":
  24.                 case "pepper":
  25.                 case "carrot":
  26.                     Console.WriteLine("vegetable");
  27.                     break;
  28.  
  29.  
  30.                 default:
  31.                     Console.WriteLine("unknown");
  32.                     break;
  33.             }
  34.         }
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement