1 #include<stdio.h> 2 #include<math.h> 3 main(){ 4 int n,k; 5 double F,P,i; 6 printf("|-----------------------------------------| "); 7 printf(" 请输入你所存入的本金:"); 8 scanf("%lf",&P); 9 printf("|-----------------------------------------| "); 10 printf(" 请输入你所存的年利率比:"); 11 scanf("%lf",&i); 12 printf("|-----------------------------------------| "); 13 printf(" 请输入你所存的年限:"); 14 scanf("%d",&n); 15 printf("|-----------------------------------------| "); 16 printf(" 请输入你所存的复利次数:"); 17 scanf("%d",&k); 18 printf("|-----------------------------------------| "); 19 20 F=P*pow(i/k+1,k*n); 21 printf(" 你所存款的复利终值为:%.4lf ",F); 22 23 }