'commit'
This commit is contained in:
33
TangDou/XiTi/1373.cpp
Normal file
33
TangDou/XiTi/1373.cpp
Normal file
@@ -0,0 +1,33 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
int o, p, q, n;
|
||||
cin >> o >> p >> q >> n;
|
||||
queue<int> oq, pq, qq;
|
||||
//填充三个队列
|
||||
for (int i = 0; i < o; ++i) {
|
||||
oq.push(i + 1);
|
||||
}
|
||||
for (int i = 0; i < p; ++i) {
|
||||
pq.push(i + 1);
|
||||
}
|
||||
for (int i = 0; i < q; ++i) {
|
||||
qq.push(i + 1);
|
||||
}
|
||||
//开始模拟轮次
|
||||
for (int i = 0; i < n; ++i) {
|
||||
int a = oq.front();
|
||||
int b = pq.front();
|
||||
int c = qq.front();
|
||||
cout << a << " " << b << " " << c << endl;
|
||||
oq.pop();
|
||||
pq.pop();
|
||||
qq.pop();
|
||||
oq.push(a);
|
||||
pq.push(b);
|
||||
qq.push(c);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user