习题二 6

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

posted @ 2013-10-21 00:16  傻子疯子捏子  阅读(85)  评论(0编辑  收藏  举报