年复利计算

 1 #include
 2 #include
 3 void tip()
 4 {
 5     printf("复利计算软件\n");
 6     printf("    复利计算公式\n");
 7     printf("\tF=P*(1+i)N(次方)\n");
 8     printf("\tF:复利终值\n");
 9     printf("\tP:本金\n");
10     printf("\ti:利率\n");
11     printf("\tN:利率获取时间的整数倍\n");
12 }
13 main()
14 {
15     int N,m;
16     double i,F=0.0,P;
17     tip();
18     printf("存入本金:");
19     scanf("%lf",&P);
20     printf("年利率:");
21     scanf("%lf",&i);
22     printf("存入年限:");
23     scanf("%d",&N);
24     printf("年复利次数:");
25     scanf("%d",&m);
26     F=P*pow((1+i/m),N*m);
27     printf("复利终值:%.4lf\n",F);
28 
29 }

年复利计算_第1张图片

转载于:https://www.cnblogs.com/zzy999/p/5257797.html

你可能感兴趣的:(年复利计算)