Advertisement
fbinnzhivko

Problem 02. Change Tiles

Dec 21st, 2016
477
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.02 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. namespace ConsoleApplication
  5. {
  6.     internal class Program
  7.     {
  8.         public static void Main(string[] args)
  9.         {
  10.             var takemoney = decimal.Parse(Console.ReadLine());
  11.             var weight = decimal.Parse(Console.ReadLine());
  12.             var height = decimal.Parse(Console.ReadLine());
  13.             var a = decimal.Parse(Console.ReadLine());
  14.             var h = decimal.Parse(Console.ReadLine());
  15.             var prize = decimal.Parse(Console.ReadLine());
  16.             var maistor = decimal.Parse(Console.ReadLine());
  17.  
  18.  
  19.             var x = (weight * height) / (a * h / 2);
  20.  
  21.  
  22.             var total = Math.Ceiling(x) + 5;
  23.             var y = total * prize + maistor;
  24.  
  25.  
  26.             if (y <= takemoney)
  27.             {
  28.  
  29.                 Console.WriteLine("{0:f2} lv left.", takemoney-y);
  30.  
  31.             }
  32.             else
  33.             {
  34.                 Console.WriteLine("You'll need {0:f2} lv more.", y-takemoney);
  35.             }      
  36.         }
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement