Advertisement
desislava777

04. Fruit or Vegetable

Oct 28th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 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 ConsoleApplication66
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. var s = Console.ReadLine();
  14. if (s == "banana" || s == "apple" || s == "kiwi" || s == "cherry" || s == "lemon" || s == "grapes")
  15. {
  16. Console.WriteLine("fruit");
  17. }
  18. else if (s == "tomato" || s == "cucumber" || s == "pepper" || s == "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