【发布时间】:2014-11-20 09:14:13
【问题描述】:
以下代码报错
ERROR: `setindex!` has no method matching setindex!(::Type{Array{Int32,32}}, ::Int32, ::Int64)
我应该能够做到这一点吗?我认为问题在于循环变量的类型错误,无法用作数组索引?
n = parseint(readline(STDIN))
A = Array{Int32, n}
for i in 1:n-1
ai = parseint(Int32, readuntil(STDIN, ' '))
A[i] = ai #The error happens here!
end
A[n] = parseint(Int32, readline(STDIN))
【问题讨论】:
标签: julia