文章
84
粉丝
2
获赞
600
访问
26.1k
#include<iostream>
#include<queue>
using namespace std;
int main() {
int n;
while (cin >> n && n != 0) {
int x, y;
cin >> x >> y;
queue<int> q;
for (int i = x; i <= n; i ++ ) q.push(i);
for (int i = 1; i < x; i ++ ) q.push(i);
while (q.size() > 1) {
for (int i = 0; i < y - 1; i ++ ) {
q.push(q.front());
q.pop();
}
cout << q.front() << ',';
q.pop();
}
cout << q.front() << endl;
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发