You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// 矩阵乘法
func matmul(A, B) {
result = [];
i = 0;
while i < A.len() {
row = [];
j = 0;
while j < B[0].len() {
sum = 0;
k = 0;
while k < A[0].len() {
sum = sum + A[i][k] * B[k][j];
k = k + 1;
}
row.push(sum);
j = j + 1;
}
result.push(row);
i = i + 1;
}
return result;
}
以下代码在测试界面报错
错误: 8:14 keywords: 使用关键字作为变量名 5:10 keywords: 使用关键字作为变量名 2:5 keywords: 使用关键字作为变量名
报错图像
初步判断为类型问题, func的形参默认类型并非数组(列表), 从而语法检查器发现
.len()
之后出错The text was updated successfully, but these errors were encountered: