Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _2._9_Padawan_Equipment
- {
- class Program
- {
- static void Main(string[] args)
- {
- double amountMoney = double.Parse(Console.ReadLine());
- int countStudents = int.Parse(Console.ReadLine());
- double priceLightsabers = double.Parse(Console.ReadLine());
- double priceRobes = double.Parse(Console.ReadLine());
- double priceBelts = double.Parse(Console.ReadLine());
- double totalpriceLightsabers = priceLightsabers * Math.Ceiling(countStudents * 1.1);
- double totalPraiceRobes = priceRobes * countStudents;
- double totalPriceBelts = (priceBelts * countStudents) - (countStudents / 6 * priceBelts);
- double totalPrice = totalpriceLightsabers + totalPriceBelts + totalPraiceRobes;
- if (amountMoney >= totalPrice)
- {
- Console.WriteLine($"The money is enough - it would cost {totalPrice:F2}lv.");
- }
- else
- {
- Console.WriteLine($"Ivan Cho will need {totalPrice - amountMoney:F2}lv more.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment