'commit'
This commit is contained in:
29
TangDou/XiTi/1371.cpp
Normal file
29
TangDou/XiTi/1371.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
int m, n, k;
|
||||
cin >> m >> n >> k;
|
||||
queue<int> man;
|
||||
queue<int> woman;
|
||||
//男士人数 m
|
||||
for (int i = 0; i < m; ++i) {
|
||||
man.push(i + 1);
|
||||
}
|
||||
//女士人数 n
|
||||
for (int i = 0; i < n; ++i) {
|
||||
woman.push(i + 1);
|
||||
}
|
||||
//输出结果
|
||||
for (int i = 0; i < k; ++i) {
|
||||
int a = man.front();
|
||||
int b = woman.front();
|
||||
cout << a << " " << b << endl;
|
||||
man.pop();
|
||||
woman.pop();
|
||||
man.push(a);
|
||||
woman.push(b);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user