Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program
- {
- static void Main(string[] args)
- {
- double priceOfTv = double.Parse(Console.ReadLine());
- double years = double.Parse(Console.ReadLine());
- double bankRate = double.Parse(Console.ReadLine());
- double friendRate = double.Parse(Console.ReadLine());
- double bankLoan = priceOfTv * (Math.Pow((1+bankRate), years));
- double friendLoan = priceOfTv * (1+friendRate);
- if (friendLoan <= bankLoan)
- {
- Console.WriteLine("{0:F2} Friend", friendLoan); return;
- }
- else
- {
- Console.WriteLine("{0:F2} Bank",bankLoan);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement