复利计算(1)
1 #include<stdio.h> 2 #include<math.h> 3 main(){ 4 int n,k; 5 double F,P,i; 6 printf("|-----------------------------------------|\n"); 7 printf(" 请输入你所存入的本金:"); 8 scanf("%lf",&P); 9 printf("|-----------------------------------------|\n"); 10 printf(" 请输入你所存的年利率比:"); 11 scanf("%lf",&i); 12 printf("|-----------------------------------------|\n"); 13 printf(" 请输入你所存的年限:"); 14 scanf("%d",&n); 15 printf("|-----------------------------------------|\n"); 16 printf(" 请输入你所存的复利次数:"); 17 scanf("%d",&k); 18 printf("|-----------------------------------------|\n"); 19 20 F=P*pow(i/k+1,k*n); 21 printf("\n你所存款的复利终值为:%.4lf\n\n",F); 22 23 }
posted on 2016-03-11 08:44 Glp_Moliny 阅读(148) 评论(0) 编辑 收藏 举报