按揭贷款-等额本金.c 367 B

1234567891011121314151617181920212223
  1. #include <stdio.h>
  2. int main() {
  3. int time;
  4. double money;
  5. scanf("%lf %d",&money,&time);
  6. double lilv;
  7. if(time <= 12) lilv = 0.0435/12;
  8. else if(time <= 60) lilv = 0.0475/12;
  9. else lilv = 0.049/12;
  10. int i;
  11. for(i = 1; i <= time; i++) {
  12. double result = money / time + (money - money / time * (i - 1)) * lilv;
  13. printf("%.1lf\n",result);
  14. }
  15. return 0;
  16. }