我正在关注这个教程,它给了我这个代码:
"Run the module `hello.ceylon`."
shared void run() {
process.write("Enter a number (x): ");
value userX = process.readLine();
value x = parseFloat(userX);
process.write("Enter a number (y): ");
value userY = process.readLine();
value y = parseFloat(userY);
if (exists x, exists y) {
print("``x`` * ``y`` = ``x * y``");
} else {
print("You must enter numbers!");
}
}
但它给了我这个信息:
参数必须可分配给 parseFloat 的参数字符串:String? 不能分配给 String
我已经复制/粘贴了这段代码,但仍然是相同的消息。