這是我得到的錯誤:錯誤:預期表達式之前 '=' 令牌
c:17:15: error: expected expression before ‘=’ token
suma + = mat[N][M];
這是我的代碼:
#include<stdio.h>
#define N 3
#define M 3
int mat[N][M]i,j,k,l,m,n;
int vector[N];
int suma;
int main (void){
for(i=0;i<N;i++){
for(j=0;j<M;j++){
printf("Enter a number: ");
scanf("%d", &mat[N][M]);
}
}
for(k=0;k<N;k++){
suma=0;
for(l=0;l<M;l++){
**suma+ = mat[N][M];
}
vector[i]=suma;
}
return 0;
}
它的工作原理!謝謝! –
你錯過了索引部分。 :) –
你是對的,雖然tbh我沒有找到,因爲問題似乎很明確:) – Idos