Playground
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { vector<int> v; v.push_back(1); v.push_back(2); v.push_back(3); do { vector<int>::iterator it; it = v.begin(); while (it != v.end()) { cout << *it << " "; it++; } cout << endl; } while (next_permutation(v.begin(), v.end())); return 0; }
Input data
Program output
no input
Execute
Language: ????????? | Memory: ???? KB | Time: ??? ms
Nothing has been executed, yet!