#include
#include
#include
#include
#include
int main()
{
const int N = 5;
std::array matrix[N]{
{-1, -2, -3, -4, -5},
{-6, -7, -8, -9, -10},
{-11, -12, -13, -14, -15},
{-16, -17, -18, -19, -20},
{-21, -22, -23, -24, -25}
};
std::vector vec;
for(int i = 0; i < N; i++)
{
for(int j = 0; j < N; j++)
{
if(j < i)
{
if(matrix[i][j] < 0)
vec.push_back(matrix[i][j]);
}
}
}
std::copy(vec.begin(), vec.end(), std::ostream_iterator(std::cout, " "));
std::cout << std::endl;</p>
}