首页
DreamJudge
院校信息
考研初试
考研复试
保研专区
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
bro
2026年2月24日 16:26
猴子报数 题解:c++,采用链表方式
P1081
回复 0
|
赞 23
|
浏览 341
#include <bits/stdc++.h> using namespace std; struct node{ int num; node *next; }; int main(){ int n,s,m; while(cin >> n >> s >> m && (n != 0 || s != 0 || m != 0)){ n...
一字清若杰
2026年2月4日 22:13
猴子报数 题解:用list + 迭代器(指针)
P1081
回复 0
|
赞 3
|
浏览 241
#include <bits/stdc++.h> using namespace std; int main() { list<int> mylist; int n, s, m; while (cin >> n >> s >> m && n != 0 && s != 0 && m != 0) { f...
xsw
2026年2月2日 09:34
猴子报数 题解:
P1081
回复 0
|
赞 6
|
浏览 254
#include<iostream> #include<queue> using namespace std; int main() { int n; while (cin >> n && n != 0) { int x, y; cin >> x >> y; queue<int> q; for (int i = x; i <= n; i ++ ) q.push(i); for (int i = 1; i < x; i ++ ) ...
mlx
2026年1月27日 20:59
猴子报数 题解:
P1081
回复 0
|
赞 5
|
浏览 306
#include<iostream> #include<vector> using namespace std; int n,s,m; int main() { while(cin>>n) { vector<int> a; cin>>s>>m; if(s==0&&m==0) break; for(int i=1;i<=n;i++) a.push_back(i); int k=s-1; while(a.size()) ...
西电机试专家
2025年2月10日 15:02
猴子报数 题解:数组模拟,马+7我要给你生小猴子
P1081
回复 1
|
赞 20
|
浏览 1.5k
#include <bits/stdc++.h> using namespace std; //思路:利用数组模拟,处理删除类问题可以考虑用其他方法进行,比如标记为删除,从而遍历之时将其跳过 int main(){ int n,s,m;//s个猴子开始报数,第m个猴子退出报数 ; while(cin>>n>>s>>m){ if(n...
曾不会
2026年1月27日 09:38
猴子报数 题解:
P1081
回复 0
|
赞 0
|
浏览 151
//数组保存,思路一定要清晰 #include<stdio.h> int main() { int n; while(scanf("%d",&n)!=EOF) { int s,m; scanf("%d %d",&s,&m); &n...
西电机试专家
2025年2月10日 15:26
猴子报数 题解:利用vector容器
P1081
回复 1
|
赞 40
|
浏览 1.5k
#include <bits/stdc++.h> using namespace std; int main(){ int n,s,m;//s个猴子开始报数,第m个猴子退出报数 while(cin>>n>>s>>m){ if(n==0)break; vector<int>a(n); &...
wuyo
2025年3月12日 21:49
猴子报数 题解:
P1081
回复 0
|
赞 4
|
浏览 1.1k
#include <iostream> #include <cstdlib> using namespace std; // 定义链表节点结构 struct node { int data; // 节点存储的数据(人的编号) node* next; // 指向下一个节点的指针 }; // 创建循环链表 node* createCircularList(int n) { node* ...
RingoCrystal
2025年1月27日 13:30
猴子报数 题解:约瑟夫问题
P1081
回复 0
|
赞 15
|
浏览 1.4k
#include <bits/stdc++.h> using namespace std; int main(){ int n,p,m; while(cin>>n>>p>>m){ if(n==0)break; vector<int>a(n); for(int i=0;i<n;i++)a[i]=i+1; p=p-1;m=m-1; while(a.size()>1){ p...
Candour
2024年5月25日 12:31
猴子报数(C++模拟) 题解:
P1081
回复 0
|
赞 4
|
浏览 1.4k
#include<bits/stdc++.h> using namespace std; int n, s, m; bool st[110]; int main() { while(cin >> n >> s >> m, n ,s ,m) { memset(st, false, sizeof st); int t = 0, cnt = 0; while(1) { for(int i = s; i <= n; i ++) { if(!st[i]) cnt...
1
2
3
4
题目
猴子报数
题解数量
32
发布题解
在线答疑
热门题解
1
猴子报数 题解:自用笔记,数组实现
2
猴子报数 题解:利用vector容器
3
猴子报数 题解:c++,采用链表方式
4
猴子报数 题解:数组模拟,马+7我要给你生小猴子
5
猴子报数 题解:约瑟夫问题
6
猴子报数 题解:循环链表
7
猴子报数 题解:根据题意模拟(约瑟夫环)
8
猴子报数 题解:采用队列模拟约瑟夫环,报数时反复将队首元素压入队尾,最后输出队头即可
9
猴子报数 题解:
10
猴子报数 题解:自用笔记(C语言)