Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program
- {
- static void Main(string[] args)
- {
- float money = float.Parse(Console.ReadLine());
- float floorWidth = float.Parse(Console.ReadLine());
- float floorLength = float.Parse(Console.ReadLine());
- float triangleSide = float.Parse(Console.ReadLine());
- float triangleHeigh = float.Parse(Console.ReadLine());
- float pricePerTile = float.Parse(Console.ReadLine());
- float expenses = float.Parse(Console.ReadLine());
- double floorArea = floorWidth * floorLength;
- double tileArea = triangleSide * triangleHeigh / 2;
- double numOfTiles = Math.Ceiling(floorArea / tileArea) + 5;
- double totalSum = numOfTiles * pricePerTile + expenses;
- double res = Math.Abs(money - totalSum);
- if (money >= totalSum) Console.WriteLine("{0} lv left.", res.ToString("F"));
- else if (money < totalSum) Console.WriteLine("You'll need {0} lv more.", res.ToString("F"));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement