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