Răspuns:
#include<iostream>
#include<fstream>
using namespace std;
int main() {
fstream f("date.in");
ofstream f_out("date.out");
int n, x;
float i = 0;
float m_a = 0;
f >> n;
i = n;
while (n != 0) {
f >> x;
m_a = m_a + x;
f_out << x << " ";
n--;
}
m_a = m_a / i;
f_out << "\n" << m_a;
}