Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace FirstStepsInCodding
- {
- class Program
- {
- static void Main(string[] args)
- {
- double berriesPrice = double.Parse(Console.ReadLine());
- double banana = double.Parse(Console.ReadLine());
- double orange = double.Parse(Console.ReadLine());
- double raspberry = double.Parse(Console.ReadLine());
- double berry = double.Parse(Console.ReadLine());
- double raspberriesPrice = berriesPrice / 2;
- double orangePrice = raspberriesPrice - raspberriesPrice * 40 / 100;
- double bananaPrice = raspberriesPrice - raspberriesPrice * 80 / 100;
- double bananaSum = bananaPrice * banana;
- double orangeSum = orangePrice * orange;
- double raspberrySum = raspberriesPrice * raspberry;
- double berrySum = berriesPrice * berry;
- double sum = bananaSum + orangeSum + raspberrySum + berrySum;
- Console.WriteLine($"{sum:F2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment