class myQueue { private: int size, *head, *tail, *data; public: myQueue(int size) // конструктор : size(size) { data = new int[size]; head = data; tail = data + size - 1; } ~myQueue() // деструктор { delete[]data; } void input(int el, int& i) { data[i] = el; } void maxEl() { int max = *data; while (head != tail) { head++; if (*head > max) { max = *head; } } cout << max; } }; int main() { setlocale(LC_ALL, "rus"); myQueue q(5); int n = 0, el; while (n < 5) { cin >> el; q.input(el, n); n++; } q.maxEl(); system("pause"); return 0; } There is a class queue in which to find the maximum element. But the maximum element is always the first element. How to fix?