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 count = int.Parse(Console.ReadLine());
- double saber = double.Parse(Console.ReadLine());
- double robe = double.Parse(Console.ReadLine());
- double belt = double.Parse(Console.ReadLine());
- double sum = 0;
- if (count < 6)
- {
- sum = (Math.Ceiling(count * 1.1) * saber) + count * robe + count * belt;
- }
- else
- {
- sum = (Math.Ceiling(count * 1.1) * saber) + count * robe + (count - count / 6) * belt;
- }
- if (money >= sum)
- {
- Console.WriteLine($"The money is enough - it would cost {sum:F2}lv.");
- }
- else
- {
- Console.WriteLine($"John will need {sum - money:F2}lv more.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement