题解列表

筛选

C++ |1017完数的判断| 不用数组、自定义函数的“笨方法”

###根本不用数组、函数!###极其明了、通俗易懂!######之所以叫笨方法,N值大了之后会明显变慢######而且该代码用了两次重复的遍历来寻找因子以便按格式输出######不过如果不需要输出因子,也就不需要重复遍历了#####因此,大佬请火速离场~#####因此,

与圆相关的计算

摘要:解题思路:注意事项:不能用“cin”和“cout”,用了就会报错。参考代码:#include<iostream>using namespace std;int main(){   double r; ……

3000:交换值(题解)

摘要:解题思路:交换值注意事项:wu参考代码:#includeusing namespace std;    int main()            {                int a,b; ……

C++阶乘20行解决

摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;void test(){ long long num,nub=1,a=0;//nub是到当前数……

简易广搜代码(不用队列,只调用数组)

摘要:解题思路:与普通广搜不同,这里要统计步数,因此我们存储移动路径的数组要多一行,存储到这一位置所需的步数,即h[x][3]注意事项:参考代码:#include<bits/stdc++.h>using n……

简易广搜代码(不用队列,只调用数组)

摘要:解题思路:首先找到第一个非零数字,细胞数加一,再用bfs遍历,把所有非零数字变成0,这就是一个细胞。再继续寻找细胞,按以上步骤重复。注意事项:参考代码:#include<bits/stdc++.h>u……

2791: 计算邮资

摘要:解题思路:注意事项:参考代码:#include<iostream> #include<cmath> #include<iomanip> using namespace std; int mai……

2790: 分段函数

摘要:解题思路:注意事项:参考代码:#include<iostream> #include<iomanip> using namespace std; int main() {     doubl……

2789: 骑车与走路

摘要:解题思路:注意事项:参考代码:#include<iostream> using namespace std; int main() {     int meter;     cin>>met……