Advertisement
TeMePyT

Untitled

May 26th, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 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 _08.Calories_Counter
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int n = int.Parse(Console.ReadLine());
  14. int callories = 0;
  15.  
  16. for (int i = 0; i < n; i++)
  17. {
  18. string ingredients = Console.ReadLine().ToLower();
  19. switch(ingredients)
  20. {
  21. case "cheese":
  22. callories += 500;
  23. break;
  24. case "tomato sauce":
  25. callories += 150;
  26. break;
  27. case "salami":
  28. callories += 600;
  29. break;
  30. case "pepper":
  31. callories += 50;
  32. break;
  33. default:
  34. break;
  35. }
  36. }
  37. Console.WriteLine($"Total calories: {callories}");
  38. }
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement