Advertisement
bacco

Плод или зеленчук?

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