Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Dieta
- {
- class Program
- {
- static void Main(string[] args)
- {
- double berriesPrice = double.Parse(Console.ReadLine());
- double bananasQuantity = double.Parse(Console.ReadLine());
- double orangesQuantity = double.Parse(Console.ReadLine());
- double raspberriesQuantity = double.Parse(Console.ReadLine());
- double berriesQuantity = double.Parse(Console.ReadLine());
- double raspberriesPrice = berriesPrice / 2;
- double orangesPrice = raspberriesPrice - (raspberriesPrice * 0.4);
- double bananasPrice = raspberriesPrice - (raspberriesPrice * 0.8);
- double berriessSum = berriesPrice * berriesQuantity;
- double bananasSum = bananasPrice * bananasQuantity;
- double orangesSum = orangesPrice * orangesQuantity;
- double rasperriesSum = raspberriesPrice * raspberriesQuantity;
- double moneyNeeded = bananasSum + berriessSum + orangesSum + rasperriesSum;
- Console.WriteLine($"{moneyNeeded:f2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement