Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _31.3zadacha
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- int nights = int.Parse(Console.ReadLine());
- string destination = Console.ReadLine();
- string roomType = Console.ReadLine();
- double price = 0;
- switch (destination)
- {
- case "Colorado":
- if (roomType == "double room")
- {
- price = 38;
- }
- else if (roomType == "apartment")
- {
- price = 45;
- }
- break;
- case "Alps":
- if (roomType == "double room")
- {
- price = 35;
- }
- else if (roomType == "apartment")
- {
- price = 42;
- }
- break;
- case "Andie":
- if (roomType == "double room")
- {
- price = 39;
- }
- else if (roomType == "apartment")
- {
- price = 49;
- }
- break;
- }
- Console.WriteLine($"They have to spend {(nights * price):F2} leva.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement