小编Aad*_*ran的帖子

为什么 Julia 在我编写和 if 语句时会抛出输入错误的过早结束?

这是我的代码:

using Printf
using Statistics

age = 12
if age < 10
    println("$age")
Run Code Online (Sandbox Code Playgroud)

这是错误:

ERROR: LoadError: syntax: incomplete: premature end of input
Stacktrace:
 [1] top-level scope at D:\julia\trial.jl:5
 [2] include(::Module, ::String) at .\Base.jl:377
 [3] exec_options(::Base.JLOptions) at .\client.jl:288
 [4] _start() at .\client.jl:484
in expression starting at D:\julia\trial.jl:5
Run Code Online (Sandbox Code Playgroud)

如果我删除 if 语句并只打印 age 的值,它会很好地工作。

julia

2
推荐指数
1
解决办法
1767
查看次数

标签 统计

julia ×1