Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace seg
- {
- class Program
- {
- static void Main(string[] args)
- {
- var days = int.Parse(Console.ReadLine());
- string Kindroom = Console.ReadLine();
- string rating = Console.ReadLine();
- double price = 0;
- if (days <= 10)
- {
- if (Kindroom == "room for one person")
- {
- price = 18 * (days - 1);
- }
- else if (Kindroom == "apartment")
- {
- price = (days - 1) * 25 * 0.70;
- }
- else if (Kindroom == "president apartment")
- {
- price = (days - 1) * 35 * 0.90;
- }
- }
- else if (days >= 11 && days <= 15)
- {
- if (Kindroom == "room for one person")
- {
- price = (days - 1) * 18;
- }
- else if (Kindroom == "apartment")
- {
- price = (days - 1) * 25 * 0.65;
- }
- else if (Kindroom == "president apartment")
- {
- price = (days - 1) * 35 * 0.85;
- }
- }
- else if (days > 15)
- {
- if (Kindroom == "room for one person")
- {
- price = (days - 1) * 18;
- }
- else if (Kindroom == "apartment")
- {
- price = (days - 1) * 25 * 0.50;
- }
- else if (Kindroom == "president apartment")
- {
- price = (days - 1) * 35 * 0.80;
- }
- }
- if (rating == "positive")
- {
- price = price + (price * 0.25);
- }
- if (rating == "negative")
- {
- price = price - (price * 0.10);
- }
- Console.WriteLine($"{price:f2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement