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;
    }

    }

  • 相关阅读:
    nmap 查看内网存活主机
    msf ms17_010 port:445
    nmap 检测ms17-010 port:445
    msf mysql port:3306
    msf ssh port:22
    Wireshark的两种过滤器与BPF过滤规则
    Wireshark使用记录
    过滤搜索引擎的抓取数据
    WEB容器开启、关闭OPTIONS方法
    代码泄露到Github
  • 原文地址:https://www.cnblogs.com/helloaworld/p/5969004.html
Copyright © 2011-2022 走看看