본문 바로가기
728x90
반응형

프로그래밍 기록/stl25

반복자 ostream_iterator,istream_iterator,fwdbiiterator,advance,wrongiter,copyoverwrite,vectorinsert,revcopy,constiterator,revit,revfind,revbase ostream_iterator #include #include using namespace std; void main() { int ari[]={1,2,3,4,5}; list li(&ari[0],&ari[5]); ostream_iterator oit(cout,","); copy(li.begin(),li.end(),oit); // copy(li.begin(),li.end(),ostream_iterator(cout,",")); } istream_iterator #include #include #include using namespace std; template void dump(const char *desc, C c) { cout.width(12); cout 2023. 12. 9.
next_permutation,inner_product,lexicographical,make_heap next_permutation #include #include #include using namespace std; template void dump(const char *desc, C c) { cout.width(12);cout 2023. 12. 9.
merge,minmax,accumulate,adjacent_difference merge #include #include #include using namespace std; template void dump(const char *desc, C c) { cout.width(12);cout 2023. 12. 9.
replace,partition,transform,sort,lower_bound replace #include #include #include using namespace std; template void dump(const char *desc, C c) { cout.width(12);cout 2023. 12. 9.
generate, remove, remove_copy, unique generate #include #include #include using namespace std; template void dump(const char *desc, C c) { cout.width(12);cout 2023. 12. 9.
random_shuffle random_shuffle #include #include using namespace std; void main() { char str[]="abcdefghijklmnopqrstuvwxyz"; randomize(); puts(str); random_shuffle(&str[0],&str[strlen(str)]);puts(str); random_shuffle(&str[0],&str[strlen(str)]);puts(str); random_shuffle(&str[0],&str[strlen(str)]);puts(str); } 2023. 12. 9.
728x90
반응형