素数算法,时间复杂度降低版 摘要:#include<bits/stdc++.h> using namespace std; bool su(int n) { if(n<2) return false; …… 题解列表 2024年08月17日 0 点赞 0 评论 374 浏览 评分:0.0
数据结构——递归篇 摘要:解题思路:参考代码:#include<bits/stdc++.h> using namespace std; void move(char a,int n,char c) { cout<<"…… 题解列表 2024年08月17日 1 点赞 0 评论 681 浏览 评分:10.0
自守数问题,简单明了,C语言 摘要:解题思路:注意事项:参考代码:#include<stdio.h> int main(){ long s,j; printf("0"); for(long i=1; i<=200000…… 题解列表 2024年08月18日 2 点赞 0 评论 867 浏览 评分:0.0
使用qsort函数排序(c语言代码) ```c#include#include#include//定义一个结构体link来存储学生的信息typedefstruct{intchinese;//语文成绩intmath;//数学成绩intenglish;//英语成绩intsum;//总分charid[100];//学生ID}link;//比较函 题解列表 2024年08月18日 0 点赞 0 评论 1162 浏览 评分:9.9
编写题解 1004: [递归]母牛的故事 - 动态规划 **递归公式**:$f(n)=f(n-1)+f(n-3)$也就是今年牛的数量等于去年牛的数量加上今年年龄满4岁牛的数量因为4岁以上的牛每年能产一头小牛然后使用动态规划及递归均可需要注意边界条件```javaimportjava.util.Scanner;/***Main*/publicclassMai 题解列表 2024年08月18日 2 点赞 0 评论 988 浏览 评分:9.9
我不知道这个叫什么算法,但是我能保证你听懂(c语言代码) 思路其实很简单。我先把那几个数按降序(从大到小)排序。为什么要降序排序呢,因为这样才方便后面的操作。接下来我定义两个数字(right,left)来分别代表数组的第一个数和最后一个数,因为我已经事先排序过了,第一个肯定是最大值,最后一个肯定是最小值。 题解列表 2024年08月18日 0 点赞 0 评论 1005 浏览 评分:9.9
尝试写、找规律 摘要:解题思路:不完全归纳法找规律day1 1day2 2day3 3day4 4--------day5 6 day6 9 day7 13day8 19参考代码:#include<bits/stdc++.…… 题解列表 2024年08月18日 0 点赞 0 评论 448 浏览 评分:0.0
两个条件——素数、回文 摘要:参考代码:#include<bits/stdc++.h> using namespace std; #define int long long int su(int n) { if(…… 题解列表 2024年08月18日 0 点赞 0 评论 478 浏览 评分:9.9
1204: 大小写转换 摘要:核心: name = 'Hello World' print(name.lower()) # 大写转小写 print(name.upper()) # 小写转大写 …… 题解列表 2024年08月18日 0 点赞 0 评论 1028 浏览 评分:0.0
计算并联电阻的阻值 摘要:解题思路:注意事项:参考代码:list = list(map(float, input().split()))c = list[0]*list[1]/(list[0]+list[1])print("%…… 题解列表 2024年08月18日 0 点赞 0 评论 785 浏览 评分:9.9