Spocoman

07. Flower Shop

Nov 16th, 2021 (edited)
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.75 KB | None | 0 0
  1. using System;
  2.  
  3. namespace FlowerShop
  4. {
  5.     class Program
  6.     {
  7.         static void Main()
  8.         {
  9.             int m = int.Parse(Console.ReadLine());
  10.             int z = int.Parse(Console.ReadLine());
  11.             int r = int.Parse(Console.ReadLine());
  12.             int k = int.Parse(Console.ReadLine());
  13.             double gift = double.Parse(Console.ReadLine());
  14.  
  15.             double sum = (m * 3.25 + z * 4 + r * 3.5 + k * 8) * 0.95;
  16.  
  17.             if (sum >= gift)
  18.             {
  19.                 Console.WriteLine($"She is left with {Math.Floor(sum - gift)} leva.");
  20.             }
  21.             else
  22.             {
  23.                 Console.WriteLine($"She will have to borrow {Math.Ceiling(gift - sum)} leva.");
  24.             }
  25.         }
  26.     }
  27. }
Add Comment
Please, Sign In to add comment