mkpetrov

Untitled

Dec 22nd, 2016
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 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 Problem_02.Change_Tiles
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. double Money = double.Parse(Console.ReadLine());
  14. double FloorWide = double.Parse(Console.ReadLine());
  15. double Floorlength = double.Parse(Console.ReadLine());
  16. double TriangleA = double.Parse(Console.ReadLine());
  17. double TriangleH = double.Parse(Console.ReadLine());
  18. double TilePrice = double.Parse(Console.ReadLine());
  19. double PriceWorker = double.Parse(Console.ReadLine());
  20.  
  21. double FloorArea = Floorlength * FloorWide;
  22. double TriangleArea = (TriangleA * TriangleH) / 2;
  23. var NeededTiles =5+Math.Ceiling(FloorArea / TriangleArea);
  24. var SumPrice = (NeededTiles * TilePrice) + PriceWorker;
  25.  
  26. if (Money>=SumPrice)
  27. {
  28.  
  29. Console.WriteLine("{0:f2} lv left.",Money-SumPrice);
  30. }
  31. else
  32. {
  33. Console.WriteLine("You'll need {0:f2} lv more.",SumPrice-Money);
  34. }
  35. }
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment