- 【例2-1】周末舞会
抄吧
- @ 2026-6-13 18:44:29
#include<bits/stdc++.h> using namespace std; queue x,y; int n,m,k; int main() { cin>>m>>n>>k; for(int i=1; i<=m; i++) { x.push(i); } for(int i=1; i<=n; i++) { y.push(i); } for(int i=1; i<=k; i++) { cout<<x.front()<<" "<<y.front()<<endl; x.push(x.front()); y.push(y.front()); x.pop(); y.pop(); } return 0; }
信息
- ID
- 333
- 时间
- ms
- 内存
- MiB
- 难度
- 2
- 标签
- 递交数
- 420
- 已通过
- 157
- 上传者