Problem Description
According to the bank's current interest rate table, enter the deposit amount from the keyboard money, deposit period year and annual interest rate, calculate the principal and interest on bank deposits
is calculated as: SUM = Money (1 + Rate) year , SUM is the total principal and interest, to retain an output decimals.
Printed book is wrong, year should index.
Entry
Bold Style
Export
Bold Style
Sample input
10000 5 0.1
Sample Output
16105.1
AC Code
#include <iostream>
#include <stdio.h>
#include <math.h>
using namespace std;
int main()
{
double money,rate,sum;
int year;
cin >> money >> year >> rate;
sum = money * pow(1 + rate, year);
printf("%.1f",sum);
return 0;
}