//假设当前国明生产总值的年增长率为10%,计算十年后我国生产总值与现在相比增长多少百分比。公式为P=(1+r)^n r为增长率,n为年数,P为与现在相比的百分比
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
double n = 10;
double r = 0.1;
double P = pow(1+r,n)*100;//p=(1+r)^n
printf("增长率为%f%\n",P);
//2.5937424601
return 0;
}
计算年增长率
最新推荐文章于 2023-10-03 11:49:36 发布