Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Problem_03.Flowers
- {
- class Program
- {
- static void Main()
- {
- int Hriz = int.Parse(Console.ReadLine());
- int Roses = int.Parse(Console.ReadLine());
- int Lal = int.Parse(Console.ReadLine());
- string Season = Console.ReadLine();
- string Holiday = Console.ReadLine();
- var sumFlowers = Hriz + Roses + Lal;
- var HrizPrice = 0.0;
- var RosesPrice = 0.0;
- var LalPrice = 0.0;
- if (Season == "Spring" || Season =="Summer")
- {
- HrizPrice = Hriz * 2.00;
- RosesPrice = Roses * 4.10;
- LalPrice = Lal * 2.5;
- }
- else if (Season == "Autumn" || Season == "Winter")
- {
- HrizPrice = Hriz * 3.75;
- RosesPrice = Roses * 4.50;
- LalPrice = Lal * 4.15;
- }
- var sum = HrizPrice + RosesPrice + LalPrice;
- if (Holiday == "Y")
- {
- sum *= 1.15;
- }
- if (Season == "Spring" && Lal >= 7)
- {
- sum *= 0.95;
- }
- if (Season == "Winter" && Roses >= 10)
- {
- sum *= 0.9;
- }
- if (sumFlowers >= 20)
- {
- sum *= 0.8;
- }
- Console.WriteLine("{0:f2}", sum + 2);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement