📄 temperature.java
字号:
/**
这个程序将使用算数运算符将一个华氏温度转变成一个摄氏温度,
然后再将一个摄氏温度转换为华氏温度,并将结果输出。
*/
class Temperature {
public static void main(String[] argv) {
float fah= 86;
System.out.println(fah+"degrees Fahrenheit is …");
// 将华氏温度转换为摄氏温度
fah=fah-32;
fah=fah/9;
fah=fah*5;
System.out.println(fah+"degree Celsius\n");
float cel = 33;
System.out.println(cel+"degrees Celsius is …");
//将摄氏温度转换为华氏温度
cel =cel*9;
cel=cel/5;
cel=cel+32;
System.out.println(cel+"degrees Fahrenheit");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -