Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Garden
- {
- static void Main()
- {
- int tomatoSeeds = int.Parse(Console.ReadLine());
- int tomatoArea = int.Parse(Console.ReadLine());
- int cucumberSeeds = int.Parse(Console.ReadLine());
- int cucumberArea = int.Parse(Console.ReadLine());
- int potatoSeeds = int.Parse(Console.ReadLine());
- int potatoArea = int.Parse(Console.ReadLine());
- int carrotSeeds = int.Parse(Console.ReadLine());
- int carrotArea = int.Parse(Console.ReadLine());
- int cabbageSeeds = int.Parse(Console.ReadLine());
- int cabbageArea = int.Parse(Console.ReadLine());
- int beansSeeds = int.Parse(Console.ReadLine());
- int totalArea = 250;
- int mainArea = (tomatoArea + cucumberArea + potatoArea +
- carrotArea + cabbageArea);
- int beansArea = 0;
- decimal tomatoCost = 0.5M;
- decimal cucumberCost = 0.4M;
- decimal potatoCost = 0.25M;
- decimal carrotCost = 0.6M;
- decimal cabbageCost = 0.3M;
- decimal beansCost = 0.4M;
- decimal totalCost = (tomatoSeeds * tomatoCost) +
- (cucumberSeeds * cucumberCost) +
- (potatoSeeds * potatoCost) +
- (carrotSeeds * carrotCost) +
- (cabbageSeeds * cabbageCost) +
- (beansSeeds * beansCost);
- Console.WriteLine("Total costs: {0}", totalCost);
- if (totalArea >= mainArea)
- {
- beansArea = totalArea - mainArea;
- if (beansArea != 0)
- {
- Console.WriteLine("Beans area: {0}", beansArea);
- }
- else
- {
- Console.WriteLine("No area for beans");
- }
- }
- else
- {
- Console.WriteLine("Insufficient area");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement