Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Garden
- {
- static void Main()
- {
- int area = 0;
- decimal seeds = 0m;
- CheckSeedsAmmount(seeds, area);
- }
- static void CheckSeedsAmmount(decimal seeds, int area)
- {
- for (int i = 0; i <= 10; i++)
- {
- if (i == 0 || i == 1)
- {
- if (i == 0)
- {
- seeds += decimal.Parse(Console.ReadLine()) * 0.5m;
- }
- else
- {
- area += byte.Parse(Console.ReadLine());
- }
- }
- if (i == 2 || i == 3)
- {
- if (i == 2)
- {
- seeds += decimal.Parse(Console.ReadLine()) * 0.4m;
- }
- else
- {
- area += byte.Parse(Console.ReadLine());
- }
- }
- if (i == 4 || i == 5)
- {
- if (i == 4)
- {
- seeds += decimal.Parse(Console.ReadLine()) * 0.25m;
- }
- else
- {
- area += byte.Parse(Console.ReadLine());
- }
- }
- if (i == 6 || i == 7)
- {
- if (i == 6)
- {
- seeds += decimal.Parse(Console.ReadLine()) * 0.6m;
- }
- else
- {
- area += byte.Parse(Console.ReadLine());
- }
- }
- if (i == 8 || i == 9)
- {
- if (i == 8)
- {
- seeds += decimal.Parse(Console.ReadLine()) * 0.3m;
- }
- else
- {
- area += byte.Parse(Console.ReadLine());
- }
- }
- if (i == 10)
- {
- seeds += decimal.Parse(Console.ReadLine()) * 0.4m;
- }
- }
- if(area < 250)
- {
- Console.WriteLine("Total costs: " + seeds);
- Console.WriteLine("Beans area: " + (250 - area));
- }
- else if(area == 250)//(area - 250 == 0)
- {
- Console.WriteLine("Total costs: " + seeds);
- Console.WriteLine("No area for beans ");
- }
- else
- {
- Console.WriteLine("Total costs: " + seeds);
- Console.WriteLine("Insufficient area ");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment