#include
#include
#include
#include
using
namespace std;
//function solve
int*solve(int n, int
m){
vector
vector
vector
int
ptrOFc = 0;
for (int i = 0; i < n+1;
i++){
a.push_back(i);
}
while (m < n){
int t =
n--;
c[ptrOFc++] = a[m];
a.erase(remove(a.begin(), a.end(),
a[m]));
for (int i = 1; i < n - m + 1; i++)
b =
a[m++];
for (int i = 1; i < m; i++)
b.push_back(a);
a =
b;
}
copy(c.begin(), c.end(), ostream_iterator
"));
return &c[0];
}
int main(){
solve(10, 2);
return
0;
}
编译器报错:
0x5ED4A893 (msvcr120d.dll) (ConsoleApplication1.exe
中)处有未经处理的异常: 将一个无效参数传递给了将无效参数视为严重错误的函数。
PS:
请高手看一下,是我使用vector容器的方法有误,还是VS软件的问题