1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | #include <iostream> using namespace std; void main( int argc, char * argv[]) { int n, *numbers, sum = 0; cin >> n; numbers = new int [n]; for ( int i = 0; i < n; i++){ cin >> numbers[i]; sum += numbers[i]; } cout << sum / n; delete numbers; } |