dsavov_02

izpit 1 100%

Mar 24th, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. using System;
  2.  
  3. public class Program
  4. {
  5. public static void Main()
  6. {
  7. int num = int.Parse(Console.ReadLine());
  8. double allmoney = 0;
  9. double money = 0;
  10. for(int i = 0 ;i < num; i++)
  11. {
  12. string type = Console.ReadLine();
  13.  
  14. if (type == "treadmill")
  15. {
  16. money += 5899;
  17. }
  18. else if (type == "cross trainer")
  19. {
  20. money += 1699;
  21. }
  22. else if (type == "exercise bike")
  23. {
  24. money += 1789;
  25. }
  26. if (type == "dumbbells")
  27. {
  28. money += 579;
  29. }
  30. }
  31. allmoney += money;
  32. Console.WriteLine("{0:F2}", allmoney);
  33. }
  34. }
Add Comment
Please, Sign In to add comment