import java.util.Scanner;

public class TemperatureConversion { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("请输入摄氏温度:"); double celsius = input.nextDouble();

    double fahrenheit = (9.0 / 5) * celsius + 32;
    System.out.println("华氏温度为:" + fahrenheit + "℉");
}

}

Java 摄氏度转华氏度:代码示例和运行结果

原文地址: https://www.cveoy.top/t/topic/qCGv 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录