acgo题库
  • 首页
  • 题库
  • 题单
  • 竞赛
  • 讨论
  • 排行
  • 团队
  • 备赛专区

    竞赛

    • CSP-J/S
    • 蓝桥杯

    考级

    • GESP
    • CPA
    • 电子学会考级
登录
注册
题目详情题解(0)讨论(0)提交记录(0)
  • 答案

    #include<iostream> #include<queue> using namespace std; int main(){ int m,l,n; cin>>m>>l>>n; queue<int> boy,girl; for(int i=1;i<=m;i++)boy.push(i); for(int i=1;i<=l;i++)girl.push(i); for(int i=1;i<=n;i++){ cout<<boy.front()<<" "<<girl.front()<<endl; boy.push(boy.front()); girl.push(girl.front()); boy.pop(); girl.pop(); } return 0; }

    userId_undefined

    zhenzhihao

    21阅读
    0回复
    1点赞
  • 答案

    #include<bits/stdc++.h> using namespace std; int main(){ int m,l,n; cin>>m>>l>>n; queue<int> boy,girl; for(int i=1;i<=m;i++)boy.push(i); for(int i=1;i<=l;i++)girl.push(i); for(int i=1;i<=n;i++){ cout<<boy.front()<<" "<<girl.front()<<endl; boy.push(boy.front()); girl.push(girl.front()); boy.pop(); girl.pop(); } return 0; }

    userId_undefined

    一只咸鱼仔

    0阅读
    0回复
    0点赞
首页