Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program
- {
- static void Main()
- {
- double balance = double.Parse(Console.ReadLine());
- int counter = int.Parse(Console.ReadLine());
- double lightsaber = double.Parse(Console.ReadLine());
- double robe = double.Parse(Console.ReadLine());
- double belt = double.Parse(Console.ReadLine());
- double beltCost = counter * belt;
- //
- //
- double saberCost = Math.Ceiling(counter * 1.1) * lightsaber;
- double dfk = Math.Ceiling(counter * 1.1);
- double total = 0;
- if (counter >= 6)
- {
- beltCost *= (5.0 / 6.0);
- }
- total = saberCost + counter * robe + beltCost;
- if (total <= balance)
- {
- Console.WriteLine($"The money is enough - it would cost {total}lv.");
- }
- else
- {
- double remaining = total - balance;
- Console.WriteLine($"John will need {remaining:D2}lv more.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment