Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace PadawanEq
- {
- class Program
- {
- static void Main(string[] args)
- {
- decimal moneyAmount = decimal.Parse(Console.ReadLine());
- int studentsCount = int.Parse(Console.ReadLine());
- decimal lightSaberPrice = decimal.Parse(Console.ReadLine());
- decimal robePrice = decimal.Parse(Console.ReadLine());
- decimal beltPrice = decimal.Parse(Console.ReadLine());
- int freeBelts = studentsCount / 6;
- decimal something = lightSaberPrice * (studentsCount + Math.Ceiling(10 / 100.0m * studentsCount));
- decimal result = something + robePrice * studentsCount + beltPrice * (studentsCount - freeBelts);
- decimal moneyDifference = moneyAmount - result;
- if(moneyDifference >= 0)
- {
- Console.WriteLine($"The money is enough - it would cost {result:F2}lv.");
- }
- else
- {
- moneyDifference = Math.Abs(moneyDifference);
- Console.WriteLine($"Ivan Cho will need {moneyDifference:F2}lv more.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment