Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _04._Fruit_or_Vegetable
- {
- class Program
- {
- static void Main(string[] args)
- {
- string product = Console.ReadLine();
- //banana, apple, kiwi, cherry, lemon и grapes -> print fruit
- //tomato, cucumber, pepper и carrot -> print vegetable
- //other -> print unknown
- if (product == "banana" || product == "apple" || product == "kiwi" || product == "cherry"
- || product == "lemon" || product == "grapes")
- {
- Console.WriteLine("fruit");
- }
- else if (product == "tomato" || product == "cucumber" || product == "pepper" || product == "carrot")
- {
- Console.WriteLine("vegetable");
- }
- else
- {
- Console.WriteLine("unknown");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment