Advertisement
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;
- using System.Globalization;
- namespace _09.PadawanEquipment
- {
- class Program
- {
- static void Main(string[] args)
- {
- string line = Console.ReadLine();
- double money = double.Parse(line);
- line = Console.ReadLine();
- int countStudents = Int32.Parse(line);
- double priceLightsaber = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture);
- double priceRobe = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture);
- double priceBelt = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture);
- double needMoney = (priceLightsaber * Math.Ceiling(countStudents * 1.1)) + (priceRobe * countStudents) + (priceBelt * (countStudents - (countStudents / 6)));
- if (needMoney <= money)
- Console.WriteLine($"The money is enough - it would cost {needMoney, 0:N2}lv.");
- else
- Console.WriteLine($"John will need {needMoney - money, 0:N2}lv more.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement