1 solutions

  • 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

    Information

    ID
    69
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By