Website Summary Files Commits Branches @commit @diff @stats
path: root / Week02 / Exercise03 / main.cpp
blob: 07f59fb7cfc29beed58a392b6ac93cb16a0d8f26 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <iostream>
#include "intarray.h"

int main() {
	unsigned N;
	std::cin >> N;

	IntArray ia = newIntArray(N);
	for (unsigned i = 0; i < ia.size; ++i)
		std::cin >> ia.elems[i];

	std::cout << ((double)ia.sum() / ia.size) << std::endl;

	deleteIntArray(ia);

	return 0;
}