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;
- namespace _09.Padawan_Equipment
- {
- class Program
- {
- static void Main(string[] args)
- {
- double moneyStart = double.Parse(Console.ReadLine());
- int student = int.Parse(Console.ReadLine());
- double lightsaberPerOne = double.Parse(Console.ReadLine());
- double roberPerOne = double.Parse(Console.ReadLine());
- double beltsPerOne = double.Parse(Console.ReadLine());
- int numberOfSabers = (int)Math.Ceiling(student * 1.10);
- int numberOfRobes = student;
- int numberOfBelts = student - (student / 6);
- double moneyNeeded = (lightsaberPerOne * numberOfSabers) + (roberPerOne * numberOfRobes) + (beltsPerOne * numberOfBelts);
- double left = moneyStart - moneyNeeded;
- if (left >= 0)
- {
- Console.WriteLine($"The money is enough - it would cost {moneyNeeded:f2}lv.");
- }
- else
- {
- Console.WriteLine($"Ivan Cho will need {Math.Abs(left):f2}lv more.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement