约瑟夫环
玩游戏 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 #include<bits/stdc++.h>using namespace std; int n,k; int main() { cin>>n>>k; queue<int> q; for(int i =1;i<=n;i++) q.push(i); while(k--){ int a; cin>>a; a%=q.size(); for(int i =1;i<=a;i++){ q.push(q.front()); q.pop(); } cout<<q.front()<<" "; q.pop(); } return 0; } 招聘 1 2 3 4 5 6 7 8 9 10...