M0Hk

FruitОrVegetable

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