Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class Program
- {
- public static void Main()
- {
- int days = int.Parse(Console.ReadLine());
- string room = Console.ReadLine();
- int PriceA = days * 70;
- int PriceP = days * 125;
- if (room == "apartment")
- {
- if (days < 10)
- {
- Console.WriteLine("{0:F2}", PriceA - PriceA * 0.3);
- }
- else if (days <= 15)
- {
- Console.WriteLine("{0:F2}", PriceA - PriceA * 0.35);
- }
- else
- {
- Console.WriteLine("{0:F2}", PriceA - PriceA * 0.5);
- }
- }
- else if (room == "president apartment")
- {
- if ( days < 10)
- {
- Console.WriteLine("{0:F2}", PriceP - PriceP * 0.1);
- }
- else if (days <= 15)
- {
- Console.WriteLine("{0:F2}", PriceP - PriceP * 0.15);
- }
- else
- {
- Console.WriteLine("{0:F2}", PriceP - PriceP * 0.2);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement