😊
2025-03-02 10:27:28
发布于:贵州
14阅读
0回复
0点赞
#include <bits/stdc++.h>
using namespace std;
queue<int>q;
int k, n, p;
int main(){
cin >> k >> n >> p;
for(int i = 1; i <= k; i ++ ) q.push(i);
while(q.size()){
cout << q.front() << " ";
q.pop();
for(int i = 0; q.size() && i < p; i ++ ){
int x = q.front();
q.pop();
q.push(x);
}
}
return 0;
}
这里空空如也
有帮助,赞一个