Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Threading;
- using System.Globalization;
- class Garden
- {
- static void Main(string[] args)
- {
- short tomatoSeeds = short.Parse(Console.ReadLine());
- byte tomatoArea = byte.Parse(Console.ReadLine());
- short cucumberSeeds = short.Parse(Console.ReadLine());
- byte cucumberArea = byte.Parse(Console.ReadLine());
- short potatoSeeds = short.Parse(Console.ReadLine());
- byte potatoArea = byte.Parse(Console.ReadLine());
- short carrotSeeds = short.Parse(Console.ReadLine());
- byte carrotArea = byte.Parse(Console.ReadLine());
- short cabbageSeeds = short.Parse(Console.ReadLine());
- byte cabageArea = byte.Parse(Console.ReadLine());
- short beansSeeds = short.Parse(Console.ReadLine());
- int vegetablesArea = tomatoArea + cucumberArea + potatoArea + carrotArea + cabageArea;
- decimal vegetablesPrice = (tomatoSeeds * 0.50m) + (cucumberSeeds * 0.40m) + (potatoSeeds * 0.25m)
- + (carrotSeeds * 0.60m) + (cabbageSeeds * 0.30m) + (beansSeeds * 0.40m);
- Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("en-US");
- Console.WriteLine("Total costs: {0:N}", vegetablesPrice);
- if (vegetablesArea < 250)
- {
- int beansArea = 250 - vegetablesArea;
- Console.WriteLine("Beans area: {0}", beansArea);
- }
- if (vegetablesArea > 250)
- {
- Console.WriteLine("Insufficient area");
- }
- if (vegetablesArea == 250)
- {
- Console.WriteLine("No area for beans");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement