[编程入门]筛选N以内的素数题解 摘要:解题思路:先定义一个判断素数的函数,再从2到n去遍历,如果是素数,则输出。注意事项:素数判断从2写起,注意要小于等于。参考代码:#includeusing namespace std;bool ssp…… 题解列表 2023年08月13日 0 点赞 0 评论 241 浏览 评分:9.9
二维数组的转置(多种方法) 摘要: 参考代码: 第一种,直接行列互换循环打印, ```c #include int main() { int a[3][3],t; for(int i=0;i…… 题解列表 2023年08月13日 0 点赞 0 评论 311 浏览 评分:0.0
LETTERS(dfs) 摘要:解题思路: 因为涉及到回溯找最长的 所以最好用dfs递归注意事项: 多练就行了 没啥注意的参考代码:/* 3 6 HFDFFB AJHGDH DGAGEH */ #include<i…… 题解列表 2023年08月13日 0 点赞 0 评论 600 浏览 评分:9.9
采用二进制移位法,循环一次即可 摘要:解题思路:采用二进制移位法,ABCDEF对应位状态为1是派出,0是留下。循环一次即可。注意事项:参考代码:#include<stdio.h>int main(){ int jieguo,max,num…… 题解列表 2023年08月12日 0 点赞 0 评论 273 浏览 评分:0.0
自然数的拆分(dfs) 摘要:解题思路:注意事项:参考代码:#include<iostream> #include<cstring> using namespace std; const int N=10010; int …… 题解列表 2023年08月12日 0 点赞 0 评论 797 浏览 评分:7.3
C++ STL max_element 摘要:## max_element > 核心部分 `min_element(nums.begin()+r,nums.begin()+l+1)` ```c++ #include #inclu…… 题解列表 2023年08月11日 0 点赞 0 评论 362 浏览 评分:0.0
二级C语言-最小绝对值 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){ int a[10],i,min,min_i; for(…… 题解列表 2023年08月11日 0 点赞 0 评论 255 浏览 评分:0.0
注意头文件包含math.h 摘要:#include<stdio.h>#include<math.h>#define S(a,b,c) (a+b+c)*0.5#define area(S,a,b,c) sqrt(S*(S-a)*(S-b…… 题解列表 2023年08月11日 0 点赞 0 评论 252 浏览 评分:0.0
1043: [编程入门]三个数字的排序(sort函数13行实现) 摘要:解题思路:sort函数用于C++中,对给定区间所有元素进行排序,默认为升序,也可进行降序排序。sort函数包含在头文件为#include<algorithm>的c++标准库中,使用的排序方法是类似于快…… 题解列表 2023年08月11日 0 点赞 0 评论 243 浏览 评分:0.0
求和训练(直接从头加到尾巴,不要分三大类相加) 摘要:解题思路:注意事项:除法运算的时候一定要注意保留两位小数参考代码:#include <stdio.h>int main(){ int i,a,b,c; float sum; scan…… 题解列表 2023年08月11日 0 点赞 0 评论 306 浏览 评分:0.0