Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp17
- {
- class Program
- {
- static void Main(string[] args)
- {
- double budgetActors = double.Parse(Console.ReadLine());
- string nameOfActor = string.Empty;
- double salaryOut = 0;
- while ((nameOfActor = Console.ReadLine()) != "ACTION")
- {
- if (nameOfActor.Length > 15)
- {
- salaryOut = budgetActors * 0.20;
- }
- else
- {
- double salary = double.Parse(Console.ReadLine());
- salaryOut = salary;
- }
- if (budgetActors < salaryOut)
- {
- Console.WriteLine($"We need {(salaryOut - budgetActors):f2} leva for our actors.");
- break;
- }
- budgetActors -= salaryOut;
- }
- if (budgetActors >= salaryOut)
- {
- Console.WriteLine($"We are left with {budgetActors:f2} leva.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement