Advertisement
Lyubohd

Untitled

Jun 24th, 2017
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.44 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 Стиропор
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             double Budget = double.Parse(Console.ReadLine());
  14.             double AreaOfHouse = double.Parse(Console.ReadLine());
  15.             double Windows = double.Parse(Console.ReadLine());
  16.             double MetersStyrofoamPerPackage = double.Parse(Console.ReadLine());
  17.             double PackageOfStyrofoamPrice = double.Parse(Console.ReadLine());
  18.        
  19.             double AreaOfWindows = Windows * 2.4;
  20.             double AreaOfHouseWithoutAreaOfWindwos = AreaOfHouse - AreaOfWindows;
  21.             double AreaOfHouseWithWastage = AreaOfHouseWithoutAreaOfWindwos * 1.10;
  22.             double NeededPackages =Math.Ceiling (AreaOfHouseWithWastage / MetersStyrofoamPerPackage);
  23.             double PriceForPackages = NeededPackages * PackageOfStyrofoamPrice;
  24.  
  25.             if (Budget >= PriceForPackages)
  26.             {
  27.                 double LeftMoney = Budget - PriceForPackages;
  28.                 Console.WriteLine("Spent: {0:F2}", PriceForPackages);
  29.                 Console.WriteLine("Left: {0:F2}", LeftMoney);
  30.             }
  31.             else
  32.             {
  33.                 double NeededMore = PriceForPackages - Budget;
  34.                 Console.WriteLine("Need more: {0:F2}", NeededMore);
  35.             }
  36.         }
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement