#include <stdio.h>
#include <math.h>
int main()
{
double amount; //第N年結算的本利和
double principal=1000.0; //本金
double rate =.05; //年利率
int year; //年數
printf("%4s%21s\n","Year", "Amount on deposit");
for (year=1;year <=10;year++){
amount = principal * pow(1.0+rate,year);
printf("%4d%21.2f\n",year, amount);
}
system("pause");
return 0;
}