#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
// 오름차순 출력
void PrintVector(vector<int>& v)
{
vector<int>::iterator iter = v.begin();
for (; iter != v.end(); iter++)
{
cout << *iter << " ";
}
cout << endl;
}
// 오름차순 출력인데 const라서 값변환 불가능
void cPrintVector(const vector<int>& v)
{
vector<int>::const_iterator citer = v.begin();
for (; citer != v.end(); citer++)
{
cout << *citer << " ";
}
cout << endl;
}
// 내림차순 출력
void rPrintVector(vector<int>& v)
{
vector<int>::reverse_iterator riter = v.rbegin();
for (; riter != v.rend(); riter++)
{
cout << *riter << " ";
}
cout << endl;
}
int main()
{
// 벡터선언 값초기화
vector<int> v1(10);
for (int i = 0; i < 10; i++)
{
v1[i] = i;
}
PrintVector(v1);
cPrintVector(v1);
rPrintVector(v1);
return 0;
}