Advertisement
OMEGAHEAD_MonkoX

OMG IMMORTAL TASK

Dec 8th, 2019
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <string>
  4. #include <sstream>
  5. #include <algorithm>
  6. #include <vector>
  7.  
  8. using namespace std;
  9.  
  10.  
  11.  
  12.  
  13. int main(){
  14. int i, k, j;
  15. k = 0;
  16. vector<int> a, i1;
  17. string str;
  18. getline(cin,str);
  19. stringstream stream(str);
  20. int tmp;
  21. while(stream >> tmp)
  22. i1.push_back(tmp);
  23. i = i1[0];
  24. getline(cin,str);
  25. stringstream stream1(str);
  26. while(stream1 >> tmp){
  27. a.push_back(tmp);}
  28. next_permutation(a.begin(), a.end());
  29. for (j = 0; j < a.size(); ++j)
  30. cout << a[j] << " ";
  31. return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement