Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Padawan_Equipment
- {
- class Program
- {
- static void Main(string[] args)
- {
- double budged = double.Parse(Console.ReadLine());
- int studentsCount = int.Parse(Console.ReadLine());
- double lightsabersPrice = double.Parse(Console.ReadLine());
- double robesPrice = double.Parse(Console.ReadLine());
- double beltsPrice = double.Parse(Console.ReadLine());
- double additionalEquipment = Math.Ceiling(studentsCount * 1.1);
- double totalSabersPrice = lightsabersPrice * additionalEquipment;
- double totalRobesPrice = robesPrice * studentsCount;
- double totalBeltsPrice = beltsPrice * studentsCount;
- double totalPrice = totalSabersPrice + totalRobesPrice + totalBeltsPrice;
- for (int i = 1; i <= studentsCount; i++)
- {
- if (i % 6 == 0)
- {
- totalPrice -= beltsPrice;
- }
- }
- if (budged >= totalPrice)
- {
- Console.WriteLine($"The money is enough - it would cost {totalPrice:F2}lv.");
- }
- else
- {
- double diff = totalPrice - budged;
- Console.WriteLine($"Ivan Cho will need {diff:F2}lv more.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement