Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Diagnostics;
- namespace demo
- {
- class Program
- {
- static void Main(string[] args)
- {
- //Доход
- //спестени пари = доход - (пари за живеене + пари за непред.)
- // спесетени пари за х месеца
- double income = double.Parse(Console.ReadLine());
- int months = int.Parse(Console.ReadLine());
- double sumPrivate = double.Parse(Console.ReadLine());
- double sumUnexpected = 0.3 * income;
- double savedMoneyPerMonth = income - sumPrivate - sumUnexpected;
- double totalMoney = months * savedMoneyPerMonth;
- double percent = savedMoneyPerMonth / income * 100;
- Console.WriteLine($"She can save {percent:F2}%");
- Console.WriteLine($"{totalMoney:F2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement