#include<stdio.h> void main() { double D, q, E, B = 0, b, X; int i, m; printf("本金:"); scanf("%lf", &D); printf("利率:"); scanf("%lf", &q); printf("月份:"); scanf("%d", &m); double f = D; for (i = 1; i <= m; i++) { E = D / m + f*q; b = f*q; printf("第%d个月的月还款额为:%6.4f 月支付利息 为:%6.4f\n", i, E, b); f = f - D / m; B = B + E; } X = B - D; printf("总还款额为:%6.4f 总支付利息为:%6.4f\n", B, X); }