Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _01.GiftboxCoverage
- {
- class Program
- {
- static void Main(string[] args)
- {
- double size = double.Parse(Console.ReadLine());
- int sheets = int.Parse(Console.ReadLine());
- double coveredAreaPerSheet = double.Parse(Console.ReadLine());
- double totalCoveredArea = 0;
- double areaBox = size * size * 6;
- for (int i = 1; i <= sheets; i++)
- {
- if (i % 3 == 0)
- {
- totalCoveredArea += coveredAreaPerSheet * 0.25;
- }
- else
- {
- totalCoveredArea += coveredAreaPerSheet;
- }
- }
- double percentage = totalCoveredArea / areaBox * 100;
- Console.WriteLine($"You can cover {percentage:f2}% of the box.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement