Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Tasks_Planner_Tasks_Planner_Description
- {
- class Program
- {
- static void Main(string[] args)
- {
- //размера на страна
- decimal sizeSide = decimal.Parse(Console.ReadLine());
- //брой листи хартия
- int countLists = int.Parse(Console.ReadLine());
- //1 лист хартия покрива(площ)
- decimal zona = decimal.Parse(Console.ReadLine());
- decimal area = sizeSide * sizeSide * 6;
- decimal sum = 0;
- for (int i = 1; i <= countLists; i++)
- {
- if (i % 3 == 0)
- {
- sum += zona * 0.25m;
- }
- else
- {
- sum += zona;
- }
- }
- decimal totalArea = (sum / area) * 100;
- Console.WriteLine($"You can cover {totalArea:f2}% of the box.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement