grach

FruitOrVegetable

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