>>51
× #include <iostream.h>
× static const int NUM = 5;

#include <algorithm>
でmin_element/max_elementがいいよ。