题解列表

筛选

A+B for Input-Output Practice (II)

摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){ int a; int arr[100]; int sum = 0; c……

A+B for Input-Output Practice (I)

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

用筛法求之N内的素数

摘要:解题思路:筛法就是把数据按从小到大的顺序排列,找到第一个素数,再筛选掉数据内所有与此数有关的数,完成之后再找下一个素数,再次筛选,以此类推注意事项:参考代码:#include<iostream>usi……

利用类型转换解Hello, world!

摘要:解题思路:利用char,把int类型转换为char类型即可注意事项:参考代码:#include<iostream>using namespace std;int main(){int a = 0;wh……

DFS(深度优先遍历)

摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h> #include<vector> using namespace std; int flag=0; class……

C++老管家的忠诚(线段树做法)

摘要:区间查询,果断想到线段树,看了一下题解有很多用的st表,但感觉st表模板太难记了,线段树相对好记很多,还是线段树更香一点。树状数组也可以求最值但得改模板。参考代码:#include using nam……

过滤多余的空格

摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){ string s; getline(cin,s); stri……