Advertisement
Guest User

fewfw

a guest
Mar 24th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 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 Gym
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. byte n = byte.Parse(Console.ReadLine());
  14. decimal sum = 0;
  15. string name;
  16.  
  17. for (; n > 0; n--)
  18. {
  19. name = Console.ReadLine();
  20.  
  21. if (name == "treadmill")
  22. {
  23. sum += 5899;
  24. }
  25. else if (name == "exercise bike")
  26. {
  27. sum += 1789;
  28. }
  29. else if (name == "dumbbells")
  30. {
  31. sum += 579;
  32. }
  33. else if (name == "cross trainer")
  34. {
  35. sum += 1699;
  36. }
  37. }
  38. Console.WriteLine($"{sum:f2}");
  39. }
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement