题解 | 矩阵计算
矩阵计算
http://www.nowcoder.com/practice/0c83231923c541d2aa15861571831ee5
标题矩阵计算
int main()
{
int N = 0;
int M = 0;
int sum = 0;
int arr[10][10] ={0};
scanf("%d %d",&N,&M);
for(int i = 0;i<N;i++)
{
for(int j = 0;j<M;j++)
{
scanf("%d",&arr[i][j]);
if(arr[i][j]>0)
{
sum +=arr[i][j];
}
}
}
printf("%d\n",sum);
return 0;
}