반응형
알고리즘/c++ 주요 문법
-
std::vector알고리즘/c++ 주요 문법 2017. 7. 22. 22:19
http://hyeonstorage.tistory.com/324 참고 #include #include #include #include using namespace std; int main(){ vector v; v.push_back(10); v.push_back(20); v.push_back(30); printf("%d\n", v.at(0)); printf("%d\n", v.at(v.size()-1)); printf("%lu\n", v.size()); v.clear(); if(v.empty()){ printf("empty~\n"); } v.push_back(30); v.push_back(10); v.push_back(20); sort(v.begin(), v.end()); for(int i=0; i