Advertisement
Stradjazz

Price per transport

Sep 8th, 2016
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 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 Transport_Price
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. var n = int.Parse(Console.ReadLine());
  14. var time = Console.ReadLine();
  15. var taxiDay = 0.70 + (n * 0.79);
  16. var taxiNight = 0.70 + (n * 0.90);
  17. var bus = 0.09 * n;
  18. var train = 0.06 * n;
  19.  
  20. var check1 = Math.Min(bus, taxiDay);
  21. var check2 = Math.Min(bus, taxiNight);
  22. var check3 = Math.Min(bus, train);
  23. var check4 = Math.Min(check1, check3);
  24. var check5 = Math.Min(check2, check3);
  25.  
  26. if (time == "day" && n < 20)
  27. {
  28. Console.WriteLine(taxiDay);
  29. }
  30. else if (time == "night" && n < 20)
  31. {
  32. Console.WriteLine(taxiNight);
  33. }
  34. else if (time == "day" && n < 100)
  35. {
  36. Console.WriteLine(check1);
  37. }
  38. else if (time == "night" && n < 100)
  39. {
  40. Console.WriteLine(check2);
  41. }
  42. else if (time == "day" && n < 5000)
  43. {
  44. Console.WriteLine(check4);
  45. }
  46. else if (time == "night" && n < 5000)
  47. {
  48. Console.WriteLine(check5);
  49. }
  50.  
  51. }
  52. }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement