#include<stdio.h>
#include<math.h>
int main()
{
double rate,capital,o,deposit;
int year;
char a;
printf("Input rate, year, capital:");
scanf("%lf,%d,%lf",&rate,&year,&capital);
printf("Compound interest (Y/N)?");
scanf(" %c",&a);
o=pow(1+rate,year);
if(a=='Y' || a=='y')
deposit = capital * o;
if(a=='N' || a=='n')
deposit = capital * (1 + rate * year);
printf("deposit = %.4f\n",deposit);
return 0;
}
“21天好习惯“ 第一期—3
最新推荐文章于 2023-10-12 20:37:17 发布