dragonbs

GodzzilaVs.Kong

Oct 22nd, 2022
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.14 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _05.Godzillavs.Kong
  4. {
  5.     internal class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double budget = double.Parse(Console.ReadLine());
  10.             int countOfStatists = int.Parse(Console.ReadLine());
  11.             double priceForOneCloth = double.Parse(Console.ReadLine());
  12.  
  13.             double clothesPrice = countOfStatists * priceForOneCloth;
  14.             double decoring = 0.1 * budget;
  15.  
  16.             if (countOfStatists > 150)
  17.             {
  18.                 clothesPrice = 0.9 * clothesPrice;
  19.             }
  20.  
  21.             double expenses = decoring + clothesPrice;
  22.  
  23.             if (expenses > budget)
  24.             {
  25.                 Console.WriteLine("Not enough money!");
  26.                 double needMoney = expenses - budget;
  27.                 Console.WriteLine($"Wingard needs {needMoney:F2} leva more.");
  28.             }
  29.             else
  30.             {
  31.                 Console.WriteLine("Action!");
  32.                 double moneyLeft = budget - expenses;
  33.                 Console.WriteLine($"Wingard starts filming with {moneyLeft:F2} leva left.");
  34.             }
  35.         }
  36.     }
  37. }
  38.  
Add Comment
Please, Sign In to add comment