acgo题库
  • 首页
  • 题库
  • 学习
  • 天梯
  • 备赛

    竞赛

    • CSP-J/S
    • 蓝桥杯

    考级

    • GESP
    • CPA
    • 电子学会考级
  • 竞赛
  • 讨论
  • 团队
  • 商城
登录
注册
题目详情提交记录(0)
  • 还行

    #include<iostream>\也可用万能头#include<bits/stdc++.h> #include<queue> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n,m; cin>>n>>m; queue<int>a; for(int i=1;i<=n;i++) { a.push(i); } int i=1; while(!a.empty()) { int b=a.front(); if(i==m) { cout<<b<<" "; a.pop(); i=1; } else { a.pop(); a.push(b); i++; } } }

    userId_undefined
    清风逸客
    出道萌新时间刺客空间掌握者循环·循环打卡人字符串·魔法使模拟·模拟练习生
    1阅读
    1回复
    1点赞
暂无数据

提交答案之后,这里将显示提交结果~

首页