Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _06.GodzillaVsKong
- {
- class Program
- {
- static void Main(string[] args)
- { //вход
- //декор = 10% от бюджета = 0.1 * бюджета - OK
- //облекло = бр. статистите * цена за облекло на 1 статист - OK
- //проверка дали имам отстъпка -> бр. стат > 150 -> обекло - 10% - OK
- //разходи = декор + облекло
- //проверка дали бюджетът покрива разходите
- double budget = double.Parse(Console.ReadLine());
- int countStatists = int.Parse(Console.ReadLine());
- double pricePerStatist = double.Parse(Console.ReadLine());
- double decorPrice = 0.1 * budget;
- double clothesPrice = countStatists * pricePerStatist;
- if (countStatists > 150)
- {
- clothesPrice = clothesPrice - 0.10 * clothesPrice; //0.9 * clothesPrice
- }
- double expenses = decorPrice + clothesPrice;
- //ако бюджетът е достатъчен -> бюджетът >= разходите
- if (budget >= expenses)
- {
- Console.WriteLine("Action!");
- double leftMoney = budget - expenses;
- Console.WriteLine($"Wingard starts filming with {leftMoney:F2} leva left.");
- }
- else //budget < expenses
- {
- Console.WriteLine("Not enough money!");
- double needMoney = expenses - budget;
- Console.WriteLine($"Wingard needs {needMoney:F2} leva more.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement