Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace FruitOrVegetable
- {
- class Program
- {
- static void Main(string[] args)
- {
- //Да се прочете от конзолата дали е плод или зеленчук въведената дума,
- //ако се въведе невалидна дума, да се изведе “unknown”.
- string WhatIsThat = Console.ReadLine().ToLower();
- if (WhatIsThat == "banana" || WhatIsThat == "cherry"
- || WhatIsThat == "kiwi" || WhatIsThat == "lemon"
- || WhatIsThat == "grapes" || WhatIsThat == "apple")
- {
- Console.WriteLine("fruit");
- }
- else if (WhatIsThat == "tomato" || WhatIsThat == "cucumber"
- || WhatIsThat == "carrot" || WhatIsThat == "pepper" )
- {
- Console.WriteLine("vegetable");
- }
- else
- {
- Console.WriteLine("unknown");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement