public class temperature {
public static void main(String []args) {
int centigrade = 37; //摄氏度变量
double Fahrenheit = 32 + centigrade * 1.8; //计算公式
System.out.println("摄氏度为:" + centigrade);
System.out.println("华氏度为:" + Fahrenheit);
}
}
Java实例(2):温度转换
最新推荐文章于 2022-04-01 13:45:38 发布