Run ID:93126
提交时间:2024-10-11 14:43:13
#include<bits/stdc++.h> using namespace std; int main(){ queue <int> q; int n,m; cin>>n>>m; for(int i=1;i<=n;i++){ q.push(i); } while(q.empty()==false){ for(int i=1;i<m;i++){ q.push(q.front()); q.pop(); } cout<<q.front()<<endl; q.pop(); } return 0; }