Advertisement
Josif_tepe

Untitled

Apr 11th, 2025
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <queue>
  4. #include <cstring>
  5. #include <map>
  6. #include <fstream>
  7. using namespace std;
  8. typedef long long ll;
  9. const int maxn = 1e6 + 2;
  10.  
  11. int main() {
  12.     ios_base::sync_with_stdio(false);
  13.     vector<int> v(4);
  14.     for(int i = 0; i < 4; i++) {
  15.         v[i] = i + 1;
  16.     }
  17.    
  18.     do {
  19.         for(int i = 0; i < 4; i++) {
  20.             cout << v[i] << " " ;
  21.         }
  22.         cout << endl;
  23.     } while(next_permutation(v.begin(), v.end()));
  24. }
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement