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