Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program
- {
- static void Main()
- {
- decimal PriceTV = int.Parse(Console.ReadLine());
- int retarnYears = int.Parse(Console.ReadLine());
- decimal bankInterest = decimal.Parse(Console.ReadLine());
- decimal friendIterst = decimal.Parse(Console.ReadLine());
- decimal dasd = 1 + bankInterest;
- double bankLoan = (double)PriceTV * Math.Pow((double)dasd, retarnYears);
- //Console.WriteLine(bankLoan);
- double friandLoan = (double)PriceTV * (1 + (double)friendIterst);
- //Console.WriteLine(friandLoan);
- if (bankLoan < friandLoan)
- {
- Console.WriteLine("{0:f2} Bank", bankLoan);
- }
- else
- {
- Console.WriteLine("{0:f2} Friend", friandLoan);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment