#include <vector>
#include <algorithm>
int main(void)
{
std::vector<int> temp;
for(int i = 0 ; i < 10 ;i ++)
temp.push_back(i);
std::sort(temp.begin(), temp.end()); // 하고나면 젤 작은게 앞에 인덱스에 보관됨 1,2,3,4,5,6,7,8,9,10 순서..
std::reverse(temp.begin(), temp.end()); //하고나면 젤 큰게 앞에 인덱스에 보관됨 10,9,8,7,6,5,4,3,2,1...
}
'컴퓨터 과학 & 영상처리 관련 > C / C++' 카테고리의 다른 글
함수 문법에서 신기한거 (0) | 2012.11.15 |
---|---|
STL map 자료구조 (0) | 2012.10.11 |
int와 float의 연산(정수와 소수) (0) | 2012.09.04 |
devcpp getchar();getchar(); 대신 system("pause"); 가능 (0) | 2012.09.03 |
static이용 함수 내에서 포인터 반환 (0) | 2012.09.03 |