SHARE
TWEET

Untitled

a guest Jan 22nd, 2020 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.                    
  3. public class Program
  4. {
  5.     public static void Main()
  6.     {
  7.         double moneyTheyHave = double.Parse(Console.ReadLine());
  8.         int studentsCount = int.Parse(Console.ReadLine());
  9.         double priceOflightsabers = double.Parse(Console.ReadLine());
  10.         double priceOfrobes = double.Parse(Console.ReadLine());
  11.         double priceOfbelts = double.Parse(Console.ReadLine());
  12.        
  13.         double totalPrice = 0;
  14.         int freeBeltsCount = studentsCount/6;
  15.        
  16.         totalPrice = Math.Ceiling(studentsCount * 1.1)* priceOflightsabers + studentsCount * priceOfrobes + (studentsCount - freeBeltsCount) * priceOfbelts;
  17.        
  18.         if (moneyTheyHave >= totalPrice)
  19.         {
  20.         Console.WriteLine($"The money is enough - it would cost {totalPrice:F2}lv.");
  21.         }
  22.         else
  23.         {
  24.             Console.WriteLine($"Ivan Cho will need {totalPrice - moneyTheyHave:F2}lv more.");
  25.         }
  26.        
  27.        
  28.     }
  29. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top