Advertisement
Guest User

Untitled

a guest
Mar 24th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 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 ConsoleApp4
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int n = int.Parse(Console.ReadLine());
  14. int sum = 0;
  15. int tdm = 5899;
  16. int ctr = 1699;
  17. int exb = 1789;
  18. int dumb = 579;
  19. string[] uredi = new string[4];
  20. uredi[0] = "treadmill";
  21. uredi[1] = "cross trainer";
  22. uredi[2] = "exercise bike";
  23. uredi[3] = "dumbbells";
  24. for (int i = 0; i < n; i++)
  25. {
  26. var arr = Console.ReadLine();
  27. if (arr == uredi[0]) sum += tdm;
  28. else if (arr == uredi[1]) sum += ctr;
  29. else if (arr == uredi[2]) sum += exb;
  30. else if (arr == uredi[3]) sum += dumb;
  31. }
  32. Console.WriteLine("{0:f2}", sum);
  33. }
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement