Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
93126 Kevin 报数问题 C++ Accepted 5 MS 276 KB 293 2024-10-11 14:43:13

Tests(5/5):


Code:

#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; }