Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Styrofoam
- {
- class Program
- {
- static void Main(string[] args)
- {
- var budget = double.Parse(Console.ReadLine());
- var areaHouse = double.Parse(Console.ReadLine());
- var windows = double.Parse(Console.ReadLine());
- var styroFoam = double.Parse(Console.ReadLine());
- var pricePackd = double.Parse(Console.ReadLine());
- var areaToCover = (areaHouse - windows * 2.4)*1.1;
- var neededPacked = Math.Ceiling(areaToCover / styroFoam);
- var price = neededPacked * pricePackd;
- if (price<=budget)
- {
- Console.WriteLine("Spent: {0:f2}", price);
- Console.WriteLine("Left: {0:f2}", budget -price);
- }
- else
- {
- Console.WriteLine("Need more: {0:f2}", price-budget);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment