Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Diagnostics.CodeAnalysis;
- using System.Linq;
- using System.Threading;
- namespace ConsoleApp1
- {
- class Exam
- {
- static void Main(string[] args)
- {
- double budget = double.Parse(Console.ReadLine());
- int students = int.Parse(Console.ReadLine());
- double pricePerSabre = double.Parse(Console.ReadLine());
- double pricePerRobe = double.Parse(Console.ReadLine());
- double pricePerBelt = double.Parse(Console.ReadLine());
- double sumMoney = pricePerSabre * Math.Ceiling(students * 1.10) + pricePerRobe * students + pricePerBelt * (students - (students / 6));
- if (budget >= sumMoney)
- {
- Console.WriteLine($"The money is enough - it would cost {sumMoney:F2}lv.");
- }
- else
- {
- Console.WriteLine($"Ivan Cho will need {sumMoney - budget:f2}lv more.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement