#include<stdio.h>
#include<math.h>
int main()
{
int i,n;
double p,r;
i=1;
n=10;
r=0.09;
p=1.0;
while (i<=n)
{
p=p*(1+r);
i++;
}
printf("10年后,我国的国民生产总值比现在增长了%f\n",p-1);
return 0;
}
Question:函数中没有次方运算?所以 (1+r)^n 是无法使用的?
原文:https://blog.51cto.com/14502155/2430598