0311复利
#include<stdio.h>
#include <math.h>
void fuli(){
double F,P,I;
int M,N;
system("cls");
printf("\t歡迎進(jìn)入復(fù)利計算軟件\n");
printf("請輸入存入本金:");
scanf("%lf",&P);
printf("請輸入年利率:");
scanf("%lf",&I);
printf("請輸入存入年限:");
scanf("%d",&N);
printf("請輸入年復(fù)利次數(shù):");
scanf("%d",&M);
printf("本金 年利率 存入年限 年復(fù)利次數(shù)\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輸出復(fù)利終值結(jié)果:%.2lf\n",F);
}
void danli()
{
double F,P,I;
int N;
system("cls");
printf("\t歡迎進(jìn)入單利計算軟件\n");
printf("請輸入存入本金:");
scanf("%lf",&P);
printf("請輸入年利率:");
scanf("%lf",&I);
printf("請輸入存入年限:");
scanf("%d",&N);
printf("本金 年利率 存入年限 \n");
printf("%.2lf %.2lf %d ",P,I,N);
F=P+P*I*N;
printf("\n輸出復(fù)利終值結(jié)果:%.2lf\n",F);
}
void benjin()
{
double F,P,I;
int M,N;
system("cls");
printf("\t歡迎進(jìn)入本金計算軟件\n");
printf("請輸入終值:");
scanf("%lf",&F);
printf("請輸入年利率:");
scanf("%lf",&I);
printf("請輸入存入年限:");
scanf("%d",&N);
printf("請輸入年復(fù)利次數(shù):");
scanf("%d",&M);
printf("終值 年利率 存入年限 年復(fù)利次數(shù)\n");
printf("%.2lf %.2lf %d %d",F,I,N,M);
I=pow((1+I/M),M)-1;
P=F/pow((1+I),N);
printf("\n輸出本金結(jié)果:%.2lf\n",P);
}
轉(zhuǎn)載于:https://www.cnblogs.com/wenting/p/5266067.html
總結(jié)
- 上一篇: 解决npm ERR! code ENOE
- 下一篇: oracle11g中SQL优化(SQL