Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace PadawanEquipment
- {
- class Program
- {
- static void Main(string[] args)
- {
- double money = double.Parse(Console.ReadLine());
- int numberOfStudents = int.Parse(Console.ReadLine());
- double priceLightsabers = double.Parse(Console.ReadLine());
- double priceRobes = double.Parse(Console.ReadLine());
- double priceBelts = double.Parse(Console.ReadLine());
- double lightSabers = Math.Ceiling(numberOfStudents + numberOfStudents*0.1);
- int freeBelts = numberOfStudents / 6;
- double totalMoneyNeeded = lightSabers * priceLightsabers + numberOfStudents * priceRobes + (numberOfStudents - freeBelts) * priceBelts;
- if (money >= totalMoneyNeeded)
- {
- Console.WriteLine($"The money is enough - it would cost {totalMoneyNeeded:f2}lv.");
- }
- else
- {
- Console.WriteLine($"Ivan Cho will need {totalMoneyNeeded-money:f2}lv more.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement