【程式語言】JAVA的第三堂課 |華氏溫度 轉 攝氏溫度 (Fahrenheit to Celsius)
Published:
by .import java.util.*;
public class hw2_1 {
public static void main(String[] args) {
System.out.print("Please input Fahrenheit:");
Scanner input = new Scanner(System.in);
double temp = input.nextDouble();
System.out.printf("Celsius is %.1f C" ,(temp*5/9) - 32);
}
}