1 条题解

  • 0
    @ 2025-11-29 12:35:42

    C :

    #include "stdio.h"
    #include "math.h"
    int main() {
        double rate, capital;
        int year;
        printf("Please enter rate, year, capital:\n");
        scanf("%lf,%d,%lf", &rate, &year, &capital);
        // 复利计算公式 deposit = capital * (1 + rate)^year
        double deposit = capital*pow(1+rate, year);
        printf("deposit=%.3f\n", deposit);
        return 0;
    }
    
    • 1

    信息

    ID
    69
    时间
    1000ms
    内存
    128MiB
    难度
    (无)
    标签
    递交数
    0
    已通过
    0
    上传者