Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Пета_задача___Лодка_за_риболов
- {
- class Program
- {
- static void Main(string[] args)
- {
- int budget = int.Parse(Console.ReadLine());
- string season = Console.ReadLine();
- int fishermans = int.Parse(Console.ReadLine());
- double price = 0;
- if (season == "Spring")
- {
- price = 3000;
- }
- else if (season == "Autumn" || season == "Summer")
- {
- price = 4200;
- }
- else if (season == "Winter")
- {
- price = 2600;
- }
- if (fishermans <= 6)
- {
- price *= 0.9;
- }
- else if (7 <= fishermans && fishermans <= 11)
- {
- price *= 0.85;
- }
- else if (12 <= fishermans)
- {
- price *= 0.75;
- }
- if (fishermans % 2 == 0 && season != "Autumn")
- {
- price *= 0.95;
- }
- if (budget >= price)
- {
- Console.WriteLine($"Yes! You have {(budget - price):f2} leva left.");
- }
- else if (price > budget)
- {
- Console.WriteLine($"Not enough money! You need {(price - budget):f2} leva.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement