发布网友 发布时间:2022-04-25 16:29
共1个回答
热心网友 时间:2023-10-17 20:28
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class TestNullPoint {
/**
* @param args
* @throws IOException
* @throws NumberFormatException
*/
public static void main(String[] args) throws NumberFormatException, IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(
System.in));
double f = Double.parseDouble(br.readLine());
double temp=getTemperature(f);
System.out.println("转换结果为"+temp);
}
/**
* 温度转换
* 华氏度转为温度
* @return
*/
public static double getTemperature(Double d){
Double temp=(d-28)/1.8;
return temp;
}
}
-----------------
公公错了,d-28改成d-32