用队列的方法解题
```cpp
#include<iostream>
#include<queue>
using namespace std;
int main()
{
int n, out,now=1;
cin >> n >> out;
queue<int> q;
for (int i = 1; i <= n; i++)
q.push(i);
while (!q.empty())
{
if (now == out)
{
now = 1;//重新计数
cout << q.front() << " ";
q.pop();
}
else
{
int current = q.front();
q.pop();
q.push(current);
now++;
}
}
return 0;
}```