Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp1
- {
- class Program
- {
- static void Main(string[] args)
- {
- double SumIvancho = double.Parse(Console.ReadLine());
- double studentsCount = int.Parse(Console.ReadLine());
- double sabresPriceOne = double.Parse(Console.ReadLine());
- double robesPriceOne = double.Parse(Console.ReadLine());
- double beltsPriceOne = double.Parse(Console.ReadLine());
- double sabresMore = Math.Ceiling(studentsCount * 10/100);
- double priceSabres = sabresPriceOne * (studentsCount + sabresMore); ///
- double priceBelts = 0;
- double robesPrice = robesPriceOne * studentsCount;
- if (studentsCount >= 6)
- {
- double priceOtstapkaForBelts = Math.Ceiling(studentsCount / 6); ////
- studentsCount -= priceOtstapkaForBelts;
- priceBelts = beltsPriceOne * studentsCount;
- }
- else
- {
- priceBelts = beltsPriceOne * studentsCount;
- }
- double total = priceSabres + priceBelts + robesPrice;
- double result = Math.Abs(total - SumIvancho);
- if (SumIvancho >= result)
- {
- Console.WriteLine($"The money is enough - it would cost {total:f2}lv.");
- }
- else
- {
- Console.WriteLine($"Ivan Cho will need {result:f2}lv more.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement