Advertisement
NadyaMisheva

zadacha 1 , 02

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