第2章基本概念8、编程计算第一、二、三月还贷剩余金额

    float loan, rate, payment;
    printf("Enter amount of loan: ");
    scanf("%f", &loan);
    printf("rate: ");
    scanf("%f", &rate);
    printf("payment: ");
    scanf("%f", &payment);

    rate = rate * 0.01 / 12;
    loan = loan + loan * rate - payment;
    printf("first payment: $%.2f\n", loan);
    loan = loan + loan * rate - payment;
    printf("second $%.2f\n", loan);
    loan = loan + loan * rate - payment;
    printf("third $%.2f\n", loan);

上一篇:视频编辑-kdenlive-001-修改工程分辨率-帧率 new profile


下一篇:POJ-1860(最短路问题,Bellman-Ford算法判正圈)