ans

062_lichangyi 2020-11-21 16:03:20 13 返回题目

#include <bits/stdc++.h> using namespace std; queue q1; queue q2; int main() { int n, m, h; cin >> n >> m >> h; for (int i = 1; i <= n; i++) q1.push(i); for (int i = 1; i <= m; i++) q2.push(i); while(h) { int a = q1.front() ,b = q2.front(); q1.pop(); q2.pop(); cout << a << ' ' << b << endl; q1.push(a); q2.push(b); h--; } return 0; }

{{ vote && vote.total.up }}