Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace SkiTrip
- {
- class Program
- {
- static void Main()
- {
- int night = int.Parse(Console.ReadLine()) - 1;
- string room = Console.ReadLine();
- string rating = Console.ReadLine();
- double price = night;
- _ = room == "room for one person" ? price *= 18
- : room == "apartment" ? price *= 25 : price *= 35;
- _ = room == "apartment" && night < 10 ? price *= 0.7
- : room == "apartment" && night >= 15 ? price /= 2
- : room == "apartment" ? price *= 0.65 : price;
- _ = room == "president apartment" && night < 10 ? price *= 0.9
- : room == "president apartment" && night >= 15 ? price *= 0.8
- : room == "president apartment" ? price *= 0.85 : price;
- _ = rating == "positive" ? price *= 1.25 : price *= 0.9;
- Console.WriteLine($"{price:f2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement