习题2-6

#include <stdio.h> 
#include <math.h> 
int main(void) 
{  
    int year;  
    double loan,money,rate,x; 
    printf("year money\n");
    scanf("%lf%lf",&loan,&rate); 
    for(year=5;year<=30;year++){ 
        x=pow(1+rate,12*year);  
        money=loan*rate*x/(x-1); 
        printf("year=%d money=%.2f\n",year,money); 
    }  
    
    return 0; 
} 

posted @ 2013-10-20 11:59  shadowtly  阅读(124)  评论(0)    收藏  举报