解题思路:
啥情况??
注意事项:
参考代码:
#include <iostream> #include <vector> #include <algorithm> using namespace std; vector<int> arr; int main(int argc, char** argv) { int n = 0; cin >> n; int index = 0; cin >> index; for (int i = 0;i < n;i++) { int temp; cin >> temp; arr.push_back(temp); } int i = 1; while(next_permutation(arr.begin(),arr.end())) { if (i == index) break; i += 1; } for (vector<int>::iterator it = arr.begin();it < arr.end();it++) cout << *it << " "; return 0; }
0.0分
2 人评分
C二级辅导-公约公倍 (C语言代码)浏览:1508 |
【绝对值排序】 (C语言代码)浏览:713 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:633 |
最小公倍数 (C语言代码)浏览:862 |
C语言程序设计教程(第三版)课后习题1.6 (C++代码)浏览:889 |
C语言程序设计教程(第三版)课后习题10.7 (C语言代码)浏览:538 |
The 3n + 1 problem (C语言代码)浏览:548 |
C语言程序设计教程(第三版)课后习题1.6 (C语言代码)浏览:466 |
C语言程序设计教程(第三版)课后习题10.2 (C语言代码)浏览:1456 |
简单的a+b (C语言代码)浏览:414 |