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 silvanadoc
- {
- class silvanadoc
- {
- static void Main(string[] args)
- {
- var chrysQuant = int.Parse(Console.ReadLine());
- var roseQuant = int.Parse(Console.ReadLine());
- var tulipQuant = int.Parse(Console.ReadLine());
- string season = Console.ReadLine();
- string holiday = Console.ReadLine();
- var flowers = 0.0;
- var flowDec = 2.0;
- int flowersCount = chrysQuant + roseQuant + tulipQuant;
- if ((season == "Spring" || season == "Summer") && holiday == "Y")
- {
- flowers = (chrysQuant * 2 + roseQuant * 4.1 + tulipQuant * 2.5) * 1.15;
- if (season == "Spring" && tulipQuant > 7)
- {
- flowers *= 0.95;
- }
- if (flowersCount > 20)
- {
- flowers *= 0.80;
- }
- }
- else if ((season == "Spring" || season == "Summer") && holiday == "N")
- {
- flowers = chrysQuant * 2 + roseQuant * 4.1 + tulipQuant * 2.5;
- if (season == "Spring" && tulipQuant > 7)
- {
- flowers *= 0.95;
- }
- if (flowersCount > 20)
- {
- flowers *= 0.80;
- }
- }
- else if ((season == "Autumn" || season == "Winter") && holiday == "Y")
- {
- flowers = (chrysQuant * 3.75 + roseQuant * 4.5 + tulipQuant * 4.15) * 1.15;
- if (season == "Winter" && roseQuant >= 10)
- {
- flowers *= 0.90;
- }
- if (flowersCount > 20)
- {
- flowers *= 0.80;
- }
- }
- else if ((season == "Autumn" || season == "Winter") && holiday == "N")
- {
- flowers = chrysQuant * 3.75 + roseQuant * 4.5 + tulipQuant * 4.15;
- if (season == "Winter" && roseQuant >= 10)
- {
- flowers *= 0.90;
- }
- if (flowersCount > 20)
- {
- flowers *= 0.80;
- }
- }
- flowers += flowDec;
- Console.WriteLine($"{flowers:f2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement