📄 temptable.txt
字号:
// Program to output a table of Celsius and Fahrenheit temperatures
// from -10 to +10
public class TempTable
{
public static void main(String[] args)
{
final double FACTOR = 9.0/5.0;
// ratio of F degree to C degree
final double SHIFT = 32; // 0 C = 32 F
final int START = -10;
final int FINISH = 10;
int thisTemp = START;
double thisInFahrenheit;
// print table headings
System.out.println("Celsius Fahrenheit");
// print table rows
while (thisTemp <= FINISH)
{
thisInFahrenheit = thisTemp * FACTOR + SHIFT;
System.out.println(thisTemp + " " +
thisInFahrenheit);
thisTemp++;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -