This commit is contained in:
HuangHai
2025-08-30 18:35:01 +08:00
commit 1f397eca87
6258 changed files with 1487241 additions and 0 deletions

26
GESP/Mkx/YueSeFuHuan.cpp Normal file
View File

@@ -0,0 +1,26 @@
#include <bits/stdc++.h>
using namespace std;
int n, m;
int main() {
cin >> n >> m;
queue<int> q; // stl的队列
// n个人进入队列
for (int i = 1; i <= n; i++)
q.push(i);
// 准备出队列
int cnt = 0;
while (q.size()) {
int x = q.front();
q.pop();
cnt++;
if (cnt % m)
q.push(x);
else
cout << x << " ";
}
return 0;
}