How can I count the number of positive elements? Thanks for the help.

  • Already easier nowhere! That does not work? - metazet
  • I do not know where to start ... how to compare? via if? - Timi

1 answer 1

Matrix - m [column] [row]

int count = 0; for(int i = 0; i < column; i++){ for(int j = 0; j < row; j++){ if(m[i][j] > 0){ count++; } } }

Something like this