题解
2025-09-23 21:08:27
发布于:广东
4阅读
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.empty()){
cout<<q.front()<<" ";
q.pop();
if(q.empty()) break;
for(int i=1;i<=p;i++){
int head = q.front();
q.pop();
q.push(head);
}
}
return 0;
}
这里空空如也
有帮助,赞一个