习题2.6商业贷款

/*还款年限-月还款表*/
#include <stdio.h> #include <math.h> int main(void) { int year; double loan,money,rate,x; scanf("%lf",&loan); scanf("%lf",&rate); printf("year money\n"); for(year=5;year<=30;year++){ /*进入循环,计算5-30年的情况*/ x=pow(1+rate,12*year); money=loan*rate*x/(x-1); printf("year=%d money=%.0f\n",year,money); } return 0; }

 

posted on 2013-10-20 23:41  yy99  阅读(165)  评论(0编辑  收藏  举报