Benjam1n:蓝桥杯2019年第十届省赛真题-等差数列(Java代码) 摘要:解题思路:注意事项:1、第一个坑是只有1个数2、第二个坑是会有公差=0的数据(第82个)记得特殊处理。参考代码:public static long gcd(long a,long b) { re…… 题解列表 2022年01月26日 0 点赞 0 评论 486 浏览 评分:9.9
标准写法,自创 摘要:#include<stdio.h> #include<string.h> #include<malloc.h> typedef struct Node{ int c; s…… 题解列表 2022年01月26日 0 点赞 0 评论 197 浏览 评分:0.0
python-拿糖果 摘要:解题思路:动态规划,建立一个数组dp[n],dp数组中的每一个值初始化为0。其中dp[i]表示当前糖果为i时,小明最多能拿多少个糖果。①建立一个函数每次筛选符合条件的p值,也就是<=sqrt(m)的m…… 题解列表 2022年01月26日 0 点赞 0 评论 777 浏览 评分:9.9
[编程入门]自定义函数求一元二次方程 摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<math.h>float n1(float a,float b,float c);float n2(float a,f…… 题解列表 2022年01月26日 0 点赞 1 评论 670 浏览 评分:9.9
最麻烦也是最容易想到的解法。 摘要:解题思路:应用if语句或者switch语句,将可能的情况一一列出来。注意事项:适用于可能的情况类型较少的!参考代码:#include <stdio.h>#include <stdlib.h>int m…… 题解列表 2022年01月26日 0 点赞 0 评论 191 浏览 评分:0.0
二级C语言-同因查找-题解(C语言代码) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int n=10; while (n < 10000) { if (n % 2 …… 题解列表 2022年01月26日 0 点赞 0 评论 177 浏览 评分:0.0
1146: C语言训练-舍罕王的失算(输出为:18446744073709551616) 摘要:解题思路:题目中的答案不对;注意事项:题目中的答案不对;参考代码:#include<stdio.h>double sum = 0,a=1;int i;void fun1(){ for (i = …… 题解列表 2022年01月26日 0 点赞 0 评论 147 浏览 评分:0.0
公约公倍数好理解版本 摘要:解题思路:利用辗转相除法注意事项:无参考代码:#include<stdio.h>int main(){ int x,y; int a,b,t=0;scanf("%d%d",&x,&y);if(x>=y…… 题解列表 2022年01月26日 0 点赞 0 评论 195 浏览 评分:0.0
完数的判断(C语言代码) 摘要:####解题思路: 题目要求:**输入一个数,并输出这个数以内的所有完数包括相应因子**。 思路: 1. 先通过for循环遍历不包括这个数本身的其他数。 2. 完数的判断依据和因子有关,所以求…… 题解列表 2022年01月26日 0 点赞 0 评论 326 浏览 评分:9.9
python-矩阵相乘 摘要:解题思路:注意事项:参考代码:def matrix_mul(A, B): return [[sum(a*b for a,b in zip(row,col)) for co…… 题解列表 2022年01月26日 0 点赞 0 评论 161 浏览 评分:0.0