1. 程式人生 > 其它 >2021-01-18 斷了7天 罪惡罪惡

2021-01-18 斷了7天 罪惡罪惡

技術標籤:java

package com.company;
import java.util.Scanner;
public class Chapter2_17 {
    public static void main(String[] args){
        Scanner input = new Scanner(System.in);
        System.out.println("Enter the temperature in Fahrenheit between -58F and 41F: ");
        double tem = input.nextDouble();
        System.out.println("Enter the wind speed(>=2) in miles per hour: ");
        double speed = input.nextDouble();

        double windChill = (int)((35.74 + 0.6215 * tem - 35.75 * Math.pow(speed, 0.16) + 0.4275 * tem * Math.pow(speed, 0.16))
                * 100000) / 100000.0;
        System.out.println("The wind chill index is " + windChill);
    }
}

package com.company;
import java.util.Scanner;
public class Chapter2_18 {
    public static void main(String[] args){
        System.out.println("a\t" + "b\t" + "pow(a,b)");
        System.out.println("1\t" + "2\t" + (int)Math.pow(1,2));
        System.out.println("2\t" + "3\t" + (int)Math.pow(2,3));
        System.out.println("3\t" + "4\t" + (int)Math.pow(3,4));
        System.out.println("4\t" + "5\t" + (int)Math.pow(4,5));
        System.out.println("5\t" + "6\t" + (int)Math.pow(5,6));

    }
}