Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Flower_Shop
- {
- class Program
- {
- static void Main(string[] args)
- {
- int magnolii = int.Parse(Console.ReadLine());
- int ziumbiuli = int.Parse(Console.ReadLine());
- int roses = int.Parse(Console.ReadLine());
- int kaktus = int.Parse(Console.ReadLine());
- double presentPrice = double.Parse(Console.ReadLine());
- double totalProfit = (magnolii * 3.25 + ziumbiuli * 4 + roses * 3.50 + kaktus * 8) - ((magnolii * 3.25 + ziumbiuli * 4 + roses * 3.50 + kaktus * 8)* 0.05);
- double diff = Math.Abs(presentPrice - totalProfit);
- if (presentPrice <= totalProfit)
- {
- diff = Math.Floor(diff);
- Console.WriteLine($"She is left with {diff} leva.");
- }
- else
- {
- diff = Math.Ceiling(diff);
- Console.WriteLine($"She will have to borrow {diff} leva.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement