Advertisement
ad2bg

FruitOrVegetable

Oct 28th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.63 KB | None | 0 0
  1. namespace FruitOrVegetable
  2. {
  3.     using System;
  4.  
  5.     class FruitOrVegetable
  6.     {
  7.         static void Main()
  8.         {
  9.             var s = Console.ReadLine();
  10.  
  11.             if (s=="banana" || s == "apple" || s == "kiwi" || s == "cherry" || s == "lemon" || s == "grapes" )
  12.             {
  13.                 Console.WriteLine("fruit");
  14.             }
  15.             else if (s == "tomato" || s == "cucumber" || s == "pepper" || s == "carrot" )
  16.             {
  17.                 Console.WriteLine("vegetable");
  18.             }
  19.             else
  20.             {
  21.                 Console.WriteLine("unknown");
  22.             }
  23.         }
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement