AlexJC

Transport Price

Aug 27th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 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. int n = int.Parse(Console.ReadLine());
  14. if (n < 1 || n > 5000)
  15. {
  16. Console.WriteLine("Wrong number");
  17. }
  18. else
  19. {
  20. var t = Console.ReadLine();
  21.  
  22. if (t == "day")
  23. {
  24. if (n < 20)
  25. {
  26. Console.WriteLine((n * 0.79) + 0.7);
  27. }
  28.  
  29. else if (n < 100)
  30. {
  31. Console.WriteLine(n * 0.09);
  32. }
  33.  
  34. else if (n <= 5000)
  35. {
  36. Console.WriteLine(n * 0.06);
  37. }
  38. }
  39.  
  40. else if (t == "night")
  41. {
  42. if (n < 20)
  43. {
  44. Console.WriteLine((n * 0.9) + 0.7);
  45. }
  46.  
  47. else if (n < 100)
  48. {
  49. Console.WriteLine(n * 0.09);
  50. }
  51.  
  52. else if (n <= 5000)
  53. {
  54. Console.WriteLine(n * 0.06);
  55. }
  56. }
  57.  
  58. else
  59. {
  60. Console.WriteLine("Wrong word");
  61. }
  62.  
  63. }
  64. }
  65. }
  66. }
Add Comment
Please, Sign In to add comment