Advertisement
Krum_50

Padowan_Equipment

Jan 17th, 2022
630
237 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Padowan_Equipment
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             double amountofmoney = double.Parse(Console.ReadLine());
  14.             int countofstudents = int.Parse(Console.ReadLine());
  15.             double priceoflightsabers = double.Parse(Console.ReadLine());
  16.             double priceofrobes = double.Parse(Console.ReadLine());
  17.             double priceofbeits = double.Parse(Console.ReadLine());
  18.             double totalprice = 0;
  19.             int countofbeits = countofstudents - countofstudents / 6;
  20.             totalprice = priceoflightsabers * Math.Ceiling(countofstudents * 1.1) + priceofrobes * countofstudents + countofbeits * priceofbeits;
  21.             double neededmoney = totalprice - amountofmoney;
  22.  
  23.             if (amountofmoney >= totalprice)
  24.             {
  25.                 Console.WriteLine($"The money is enough - it would cost {totalprice:f2}lv.");
  26.             }
  27.             else
  28.             {
  29.                 Console.WriteLine($"Ivan Cho will need {neededmoney:f2}lv more.");
  30.             }
  31.  
  32.         }
  33.     }
  34. }
  35.  
  36.  
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement