본문 바로가기
C++/라이브러리 (STL etc)

[STL] 순열과 조합, next_permutation

by 스프링섬머 2023. 10. 8.
728x90

#include<algorithm>

 

// next_permutation 기본 형식

int a[3] = {1,2,3}

do{

     for(int i=0; i<3; i++)

      cout << a[i];

} while(next_permutation(a, a+3));

 

순열

 

조합

 

728x90