0309 复利算法

#include<stdio.h>
#include <math.h>
main()
{
double F,P,I;
int M,N;
printf("\t欢迎进入复利计算软件1.0\n");
printf("请输入存入本金:");
scanf("%lf",&P);
printf("请输入年利率:");
scanf("%lf",&I);
printf("请输入存入年限:");
scanf("%d",&N);
printf("请输入年复利次数:");
scanf("%d",&M);
printf("本金 年利率 存入年限 年复利次数\n");
printf("%.2lf %.2lf %d %d",P,I,N,M);
I=pow((1+I/M),M)-1;
F=P*pow((1+I),N);
printf("\n输出复利终值结果:%.2lf\n",F);
}

posted @ 2016-03-11 08:33  52王俊杰  阅读(162)  评论(0编辑  收藏  举报