题解列表

筛选

哥德巴赫曾猜测

摘要:解题思路:isprime  函数用于判断一个整数是否为素数。 首先处理一些特殊情况,如果  n  小于等于 1 则不是素数,如果小于等于 3 则是素数,如果能被 2 或 3 整除也不是素数。 然后通过……

计算一个整数N的阶乘C++版

摘要:```cpp #include /* 这里也可以用万能头,看看自己的喜爱: #include #include //这里Windows.h不能使用,不然会错 */ using name……

翁恺解题思路

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){int a,b,c;int max=0;scanf("%d%d%d",&a,&b,&c);if(a>b){if(a……

字符序列模式识别-题解(C++代码)

摘要:解题思路:首先注意本题的条件,1、子串大小为0<s<1000,那么两个串大小最大为999+999=1998,最小为1+1=2,再加上中间&字符,所以整个串长度为3<=s<=1999;2、第二个判断,如……

字符串内排序 vector

摘要:解题思路:注意事项:参考代码:#include"bits/stdc++.h" using namespace std; int main(){     // 定义一个字符串变量,用于存储输入的一……

1268: 第K极值

摘要:解题思路:注意事项:参考代码:#include"bits/stdc++.h" using namespace std; bool f(int x){     // 如果x小于等于1,则不是素数 ……

掌握反向迭代就行

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

1739: 成绩排序 sort+结构体 包看懂

摘要:解题思路:注意事项:参考代码:#include"bits/stdc++.h" using namespace std; // 定义结构体xs,包含三个成员变量:字符串x、整数y和整数z stru……

二级C语言-温度转换

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int a[51];int b[51];int main(){    a[0]=-100;    for(int i=0; i<51; ……