<分区>
所以这是我正在使用的代码的一部分,我们只应该从修复一些由于错误答案而导致的逻辑错误开始。我还发现了一些语法错误,这些错误不会让编译器完成...我一直为 fToC 获取“0”...
//declaration statements
final int BOILING_IN_F = 212;
int fToC;
string output;
//there is other code between that has nothing
//to do with outputting the boiling point.
fToC = (5/9) * (BOILING_IN_F - 32);
output = BOILING_IN_F + " in Fahrenheit is " + fToC
+ " in Celsius.";
System.out.println(output); //this is outputting 0 for fToC
System.out.println();
答案很有用,除了我需要在编译和运行程序之前将 fToC 声明为 double。谢谢。