Java 摄氏度转华氏度:代码示例和运行结果
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 + "℉");
}
}
原文地址: https://www.cveoy.top/t/topic/qCGv 著作权归作者所有。请勿转载和采集!