zoukankan      html  css  js  c++  java
  • 试验4

    package com.wuchaghao.test2;

    import java.util.Scanner;

    public class t2 {
    public static void main(String []args ){

    Scanner scan = new Scanner(System.in);
    System.out.println("请输入一个金额");
    double money = scan.nextDouble();
    System.out.println("请输入年限");
    int year = scan.nextInt();

    for(double i = 0.05;i<=0.08;i+=0.00125){
    System.out.print("利率:"+i);
    double monthper = i/12;
    double monthmoney = (money*monthper)/(1-(1/(Math.pow((1+monthper), (year*12)))));
    System.out.print("月还款:"+monthmoney);
    System.out.println("总还款:"+monthmoney*12*year);

    }

    }

    }

    package com.wuchanghao.test1;

    import java.util.Scanner;

    public class t1 {
    public static void main(String[] args){

    while(true){
    System.out.println("请输入一个数");
    Scanner scan = new Scanner(System.in);
    int num = scan.nextInt();
    double sum= 0;

    for(int i = 1;i<=num;i++){
    tools ts = new tools();
    sum = sum+ts.getnum(i);
    }
    System.out.println("结果是:"+4*sum);
    }
    }

    }


    package com.wuchanghao.test1;

    public class tools {
    public double getnum(int i){
    double result = 0.00;
    if((i%2)!=0){
    result = (1/(double)(2*i-1));
    }
    else{
    result = -(1/(double)(2*i-1));
    }
    return result;
    }

    }

  • 相关阅读:
    Winform开发框架之终极应用 伍华聪 博客园
    DZ外部调用登陆
    利用服务定时执行
    winForm写cookie经过
    正则第一天
    NHibernate
    Databases supported by NHibernate
    定时执行
    NHibernate视频教程
    bernate异常及处理方法
  • 原文地址:https://www.cnblogs.com/helloaworld/p/5969004.html
Copyright © 2011-2022 走看看