Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- 2
- 3
- namespace Testing
- 4
- {
- 5
- class MainClass
- 6
- {
- 7
- public static void Main (string[] args)
- 8
- 9
- {
- 10
- 11
- var money = decimal.Parse (Console.ReadLine ());
- 12
- var florWidth = decimal.Parse (Console.ReadLine ());
- 13
- var florLength = decimal.Parse (Console.ReadLine ());
- 14
- var trianglSide = decimal.Parse (Console.ReadLine ());
- 15
- var triangleHigh = decimal.Parse (Console.ReadLine ());
- 16
- var blockPrice = decimal.Parse (Console.ReadLine ());
- 17
- var priceForWork = decimal.Parse (Console.ReadLine ());
- 18
- 19
- var florArea = florWidth * florLength;
- 20
- var blockArea = trianglSide * triangleHigh / 2;
- 21
- var blockNeed = Math.Ceiling (florArea / blockArea) + 5;
- 22
- //var blockNeed2 = Math.Ceiling (florArea / blockArea) + 5;
- 23
- var totalCost = blockNeed * blockPrice + priceForWork;
- 24
- var moneyLeft = money - totalCost;
- 25
- if (moneyLeft >= 0) {
- 26
- Console.WriteLine ("{0:f2} lv left.", moneyLeft);
- 27
- }
- 28
- else {
- 29
- 30
- Console.WriteLine ("You'll need {0:f2} lv more.", totalCost - money);
- 31
- 32
- }
- 33
- }
- 34
- }
- 35
- }
- 36
Advertisement
Add Comment
Please, Sign In to add comment