Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Flowers
- {
- class Program
- {
- static void Main(string[] args)
- {
- int hriz = int.Parse(Console.ReadLine());
- int rose = int.Parse(Console.ReadLine());
- int lale = int.Parse(Console.ReadLine());
- string season = Console.ReadLine();
- string holiday = Console.ReadLine();
- double sum = 0;
- if (season == "Spring" || season == "Summer")
- {
- sum = 2 * hriz + 4.1 * rose + 2.5 * lale;
- }
- else if (season == "Autumn" || season== "Winter")
- {
- sum = 3.75 * hriz + 4.5 * rose + 4.15 * lale;
- }
- if (holiday == "Y")
- {
- sum = sum * 1.15;
- }
- if (lale > 7 && season == "Spring")
- {
- sum = 0.95 * sum;
- }
- if (rose >=10 && season == "Winter")
- {
- sum = 0.9 * sum;
- }
- if (hriz + rose + lale > 20)
- {
- sum = 0.8 * sum;
- }
- Console.WriteLine($"{sum + 2:F2}");
- }
- }
- }
Add Comment
Please, Sign In to add comment