求助大神:帮忙找找错误
#include<stdio.h>#include<math.h>
int main( void )
{
int n;
double r = 0;
double sum = 0;
double addnum = 0;
int i;
scanf( "%d", &n );
scanf( "%f", &r );
printf( "year\tpopulation\taddnumber\n" );
sum = n;
for( i = 1; i <= 75; i++ ){
//sum = n * pow( r + 1, i );
sum *= r + 1;
addnum = sum - sum / ( r + 1 );
printf( "%3d%14.2f%15.2f\n", i,sum,addnum );
}
return 0;
}//我的本意是想打印3列数,第一列是1到75;第2列是sum,第3列是addnum,怎么我运行后发现,sum的值怎么不变啊,addnum总是0;