Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Globalization;
- using System.Linq;
- using System.Threading;
- namespace ConsoleTests
- {
- class ConsoleTests
- {
- static void Main()
- {
- Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-GB");
- int[] seeds = new int[5];
- int[] areas = new int[5];
- decimal[] vegetablesPrices = new decimal[]{0.5M, 0.4M, 0.25M, 0.6M, 0.3M};
- for (int i = 0; i < 5; i++)
- {
- seeds[i] = int.Parse(Console.ReadLine());
- areas[i] = int.Parse(Console.ReadLine());
- }
- int beansSeeds = int.Parse(Console.ReadLine());
- decimal beansPrice = 0.4M;
- decimal totalSeedsCost = 0;
- for (int i = 0; i < 5; i++)
- {
- totalSeedsCost += seeds[i]*vegetablesPrices[i];
- }
- totalSeedsCost += beansSeeds*beansPrice;
- Console.WriteLine("Total costs: {0:F2}", totalSeedsCost);
- double areaSum = areas.Sum();
- if (areaSum > 250)
- {
- Console.WriteLine("Insufficient area");
- }
- else if (areaSum < 250)
- {
- Console.WriteLine("Beans area: {0}", 250-areaSum);
- }
- else
- {
- Console.WriteLine("No area for beans");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment