成了,经典的约瑟夫环问题 有n人围成一圈,顺序排号。从第1个人开始报数(从1到3报数),凡报到3的人退出圈子,问最后留下的是原来的第几号的那位。 摘要:解题思路:建立c++的list容器,将数据输入,每搁三个判断一下,删除,继续判断,最后找到剩余的元素,输出注意事项:本次使用,学到了auto的新用法 参考代码:#include<iostream> …… 题解列表 2024年06月27日 0 点赞 0 评论 204 浏览 评分:0.0
按照题目思路解题 摘要:解题思路:注意事项:参考代码:void Calculate(int in) { int drink = 0; //记录累计喝下的汽水个数 int replace = 0; //…… 题解列表 2024年06月27日 0 点赞 0 评论 160 浏览 评分:0.0
递归实现python 递归 摘要:def max(a,b): r = a % b while r != 0: a = b b =&n 题解列表 2024年06月27日 1 点赞 0 评论 336 浏览 评分:0.0
台球碰撞题目答案解析 摘要:解题思路:我这个肯定不是最优解,大家看看就行。其实需要注意的就是圆和矩形相切的问题以及碰撞之前圆心的运动轨迹和碰撞之后的圆心的运动轨迹是互相垂直的就行了。注意事项:注意角度是要转换到PI上,in_3.…… 题解列表 2024年06月28日 0 点赞 0 评论 253 浏览 评分:0.0
二分法求解过程 摘要:解题思路:注意事项:参考代码:#include<stdint.h>#include<stdio.h>#include<math.h>//这里主要是考察二分法求方程的根#define EPS …… 题解列表 2024年06月29日 0 点赞 0 评论 272 浏览 评分:0.0
编写题解 1676: 数据结构-链表的基本操作 摘要: #include #include #include typedef struct node { int n; struct n…… 题解列表 2024年06月30日 1 点赞 0 评论 257 浏览 评分:0.0
1852: 求1+2+3+...+n的值 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;typedef long long ll;//自定义//求1+2+3+......…… 题解列表 2024年06月30日 0 点赞 0 评论 138 浏览 评分:0.0
题解 1852: 求1+2+3+...+n的值 摘要:```cpp #include using namespace std; typedef long long ll; const int N=1e7+5; ll man(ll x) { …… 题解列表 2024年06月30日 0 点赞 0 评论 115 浏览 评分:0.0
2247: 蓝桥杯算法提高-输出三个整数的最大数 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;typedef long long ll;ll myMax (ll x,ll y,…… 题解列表 2024年06月30日 0 点赞 0 评论 140 浏览 评分:0.0
题解 1029: [编程入门]自定义函数处理素数 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int sushu(int n){ int g; for(int i=2;i<=s…… 题解列表 2024年06月30日 0 点赞 0 评论 150 浏览 评分:0.0