题解列表

筛选

题目1143 素数问题

摘要:解题思路:注意事项:参考代码:package exit;import java.util.Scanner;//题目1143public class test {    public static vo……

1157: 亲和数

摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using  namespace std;int zys(int x){    int sum=0;    for(int……

1199: 哥德巴赫曾猜测

摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using  namespace std;int zs(int x)//判断是否为质数{    if(x<2)    { ……

1017: [编程入门]完数的判断

摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using  namespace std;int wan(int x){    int sum=0;    for(int……

鸡尾酒疗法(注意审题)

摘要:注意事项: 第一行是原治疗法的效率,后面几行治疗的效率都同第一行的作比较 只要理解了题目,就好做了 参考代码: ```c #include int main() { int n; ……
优质题解

纪念品分组—双指针(简单易懂)

摘要:解题思路:双指针,通过两个变量i,j分别从左和从右遍历整个数组(需先排序)当gifts[i] + gifts[j] >w时,说明没有任何一个物品可以和gifts[j]一组还能保证小于限定值w(因为gi……

用递归调用解决猴子吃桃

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int n;int f(int x){//递归,每次都跟后一天有关  if(x==n){ return 1; }else{ retu……