zoukankan      html  css  js  c++  java
  • 0311复利

    #include<stdio.h>
    #include <math.h>

    void fuli(){
    double F,P,I;
    int M,N;
    system("cls");
    printf("\t欢迎进入复利计算软件\n");
    printf("请输入存入本金:");
    scanf("%lf",&P);
    printf("请输入年利率:");
    scanf("%lf",&I);
    printf("请输入存入年限:");
    scanf("%d",&N);
    printf("请输入年复利次数:");
    scanf("%d",&M);
    printf("本金 年利率 存入年限 年复利次数\n");
    printf("%.2lf %.2lf %d %d",P,I,N,M);
    I=pow((1+I/M),M)-1;
    F=P*pow((1+I),N);
    printf("\n输出复利终值结果:%.2lf\n",F);
    }

    void danli()
    {

    double F,P,I;
    int N;
    system("cls");
    printf("\t欢迎进入单利计算软件\n");
    printf("请输入存入本金:");
    scanf("%lf",&P);
    printf("请输入年利率:");
    scanf("%lf",&I);
    printf("请输入存入年限:");
    scanf("%d",&N);
    printf("本金 年利率 存入年限 \n");
    printf("%.2lf %.2lf %d ",P,I,N);
    F=P+P*I*N;
    printf("\n输出复利终值结果:%.2lf\n",F);
    }

    void benjin()
    {
    double F,P,I;
    int M,N;
    system("cls");
    printf("\t欢迎进入本金计算软件\n");
    printf("请输入终值:");
    scanf("%lf",&F);
    printf("请输入年利率:");
    scanf("%lf",&I);
    printf("请输入存入年限:");
    scanf("%d",&N);
    printf("请输入年复利次数:");
    scanf("%d",&M);
    printf("终值 年利率 存入年限 年复利次数\n");
    printf("%.2lf %.2lf %d %d",F,I,N,M);
    I=pow((1+I/M),M)-1;
    P=F/pow((1+I),N);
    printf("\n输出本金结果:%.2lf\n",P);
    }

  • 相关阅读:
    6月17日
    6月16日
    6月15日
    6月14日
    6月13日
    6月12日
    6月11日
    6月10日
    6月8日
    6月5日
  • 原文地址:https://www.cnblogs.com/wenting/p/5266067.html
Copyright © 2011-2022 走看看