12345678910111213141516
std::vector<std::vector<double> > B( 3, std::vector<double>(5 ) ); std::vector<double> maxp(3);std::vector<double> minp(3);int ss;int ctt; B[0][0]=1;B[0][1]=2;B[0][2]=5;B[0][3]=3;B[0][4]=4; B[1][0]=2;B[1][1]=4;B[1][2]=2;B[1][3]=3;B[1][4]=4; B[2][0]=3;B[2][1]=3;B[2][2]=1;B[2][3]=2;B[2][4]=5; minp[0]=6;minp[1]=5;minp[2]=1;maxp[0]=8;maxp[1]=8;maxp[2]=2; ctt=0; for (int j=0;j<int(B[0].size());j++){ss=0; for (int k=0;k<=2;k++){ ss=ss+ (B[k][j]<=minp[k] || B[k][j]>=maxp[k]); } if (ss>0){ctt=ctt+1;} }