假如我国国民生产总值的年增长率为7%,计算10年后我国国民生产总值与现在相比增长多少百分比
#include <stdio.h>
#include <stdlib.h>
int main()
{
double p, r;
p = 1.0;
scanf("%lf", &r);
for (int i = 0; i < 10; i++)
{
p *= (1 + r);
}
printf("%lf", p*100);
system("pause");
return 0;
}
答案
假如我国国民生产总值的年增长率为7%,计算10年后我国国民生产总值与现在相比增长多少百分比