Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace exerricsee
- {
- class Program
- {
- static void Main(string[] args)
- {
- double months = int.Parse(Console.ReadLine());
- double percent = int.Parse(Console.ReadLine());
- double rent = double.Parse(Console.ReadLine());
- double firstPeriod = months / 2;
- double secondPeriod = months - firstPeriod;
- double firstPeriodPrice = firstPeriod * rent;
- double secondPeriodPrice = secondPeriod * (rent * 0.80);
- double price = firstPeriodPrice + secondPeriodPrice;
- double broker = price * (percent / 100);
- double totalPrice = price + broker;
- Console.WriteLine($"Total: {totalPrice:f2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement