Advertisement
Guest User

SandBox

a guest
Feb 26th, 2018
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.89 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Sandbox
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             double width = double.Parse(Console.ReadLine());
  14.             double lenght = double.Parse(Console.ReadLine());
  15.             double sandPrice = double.Parse(Console.ReadLine());
  16.             double boardPrice = double.Parse(Console.ReadLine());
  17.  
  18.            
  19.             double sandArea = (width - 0.4) * (lenght - 0.4);
  20.             double boardArea = width * lenght - sandArea;
  21.             double sandNeeded = Math.Ceiling(sandArea * 20);
  22.             double boardsNeeded = Math.Ceiling(boardArea / 0.44);
  23.             double totalPrice = sandNeeded * sandPrice + boardsNeeded * boardPrice;
  24.  
  25.             Console.WriteLine($"{totalPrice:F2}");
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement