The problem is poorly formulated, or missing data: are we sure that, at the most, there will only be 1 a student above the average age?
To show all ages above average, we have no choice but to store them somewhere, and check them, a posteriori , one after the other. Otherwise, we can only know if a certain age is above to all those introduced so far . Which can rule out several ages that meet the condition of being above average .
#include <iostream>
using namespace std;
int main( ) {
int *lista;
int acu = 0, n, idx, edad;
cout << "Ingrese la cantidad de alumnos: ";
cin >> n;
lista = new int[n];
for( idx = 0; idx < n; ++idx ) {
cout << "Edad del alumno "<< idx + 1 <<": ";
cin >> edad;
lista[idx] = edad;
acu += edad;
}
acu /= n;
cout << "Edad promedio: " << acu << "\n";
cout << "Edades superiores al promedio:\n;
for( idx = 0; idx < n; ++idx )
if( lista[idx] > acu ) {
cout << "alumno " << idx + 1 << ", edad " << lista[idx] << "\n";
return 0;
}