Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2020
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Tasks_Planner_Tasks_Planner_Description
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. //размера на страна
  10. decimal sizeSide = decimal.Parse(Console.ReadLine());
  11. //брой листи хартия
  12. int countLists = int.Parse(Console.ReadLine());
  13. //1 лист хартия покрива(площ)
  14. decimal zona = decimal.Parse(Console.ReadLine());
  15.  
  16. decimal area = sizeSide * sizeSide * 6;
  17. decimal sum = 0;
  18.  
  19. for (int i = 1; i <= countLists; i++)
  20. {
  21. if (i % 3 == 0)
  22. {
  23. sum += zona * 0.25m;
  24. }
  25. else
  26. {
  27. sum += zona;
  28. }
  29. }
  30. decimal totalArea = (sum / area) * 100;
  31. Console.WriteLine($"You can cover {totalArea:f2}% of the box.");
  32. }
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement