Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- #include <string>
- #include <sstream>
- #include <algorithm>
- #include <vector>
- using namespace std;
- int main(){
- int i, k, j;
- k = 0;
- vector<int> a, i1;
- string str;
- getline(cin,str);
- stringstream stream(str);
- int tmp;
- while(stream >> tmp)
- i1.push_back(tmp);
- i = i1[0];
- getline(cin,str);
- stringstream stream1(str);
- while(stream1 >> tmp){
- a.push_back(tmp);}
- next_permutation(a.begin(), a.end());
- for (j = 0; j < a.size(); ++j)
- cout << a[j] << " ";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement