解题思路:
啥情况??
注意事项:
参考代码:
#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语言程序设计教程(第三版)课后习题6.7 (C语言代码)浏览:520 |
大神老白 (C语言代码)浏览:645 |
WU-C语言程序设计教程(第三版)课后习题11.11 (C++代码)(想学链表的可以看看)浏览:1358 |
【求[X,Y]内被除3余1并且被除5余3的整数的和】 (C语言代码)浏览:675 |
C语言程序设计教程(第三版)课后习题8.8 (C语言代码)浏览:546 |
文科生的悲哀 (C语言代码)浏览:1401 |
Tom数 (C语言代码)浏览:495 |
剪刀石头布 (C语言代码)浏览:1436 |
A+B for Input-Output Practice (I) (C语言代码)浏览:431 |
拆分位数 (C语言代码)浏览:522 |