You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
605 B

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