-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
以下代码在测试界面报错
错误: 8:14 keywords: 使用关键字作为变量名 5:10 keywords: 使用关键字作为变量名 2:5 keywords: 使用关键字作为变量名
// 矩阵乘法
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;
}
初步判断为类型问题, func的形参默认类型并非数组(列表), 从而语法检查器发现.len()之后出错
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
