Advertisement
Guest User

Fruit or Vegetable

a guest
Feb 6th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 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 fruit_or_vegetable
  10. {
  11. static void Main(string[] args)
  12. {
  13. string s = Console.ReadLine();
  14. if (s == "banana" || s == "apple" || s == "cherry" || s == "kiwi" || s == "lemon" || s == "grapes")
  15. Console.WriteLine("fruit");
  16. else if (s == "tomato" || s == "cucumber" || s == "pepper" || s == "carrot")
  17. Console.WriteLine("vegetable");
  18. else Console.WriteLine("unknown");
  19.  
  20. //banana, apple, kiwi, cherry, lemon и grapes tomato, cucumber, pepper и carrot
  21.  
  22. }
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement