#include <iostream>
#include <vector>
using namespace std;
int main()
{
int n;
cin >> n;
vector<int> array;
for (int i = 0; i < n; ++i)
{
int input;
cin >> input;
array.push_back(input);
}
cout << array[0] << endl;
cout << array[array.size() / 2] << endl;
cout << array[array.size() - 1] << endl;
return 0;
}
벡터를 이용하여 구현했습니다