用C语言解决母牛的故事[递归] 摘要:#### 解题思路:递归 题目的难点在于每年出生的母牛数量是不固定的,并且是每年都存在不固定数量的母牛加入生产母牛的行列。 #### 递归思路的体现: 先去考虑每年能够增加的母牛数量,再考虑这一…… 题解列表 2023年02月11日 0 点赞 0 评论 228 浏览 评分:0.0
两种解法哪种更优?还是? 摘要:直接for循环求解 ```cpp #include #include using namespace std; int main() { int a,b; for(int i=10…… 题解列表 2023年02月11日 0 点赞 0 评论 178 浏览 评分:0.0
<循环>阶乘求和(C语言) 摘要:解题思路:#include<stdio.h> int main() { int n; long long Sn=0, x = 1; scanf("%d", &n); for (in…… 题解列表 2023年02月11日 0 点赞 0 评论 127 浏览 评分:0.0
<循环>角谷猜想(C语言) 摘要:#include<stdio.h> int main() { int n,x,y; scanf("%d", &n); while (n > 0)//未知循环次数用while语句 {…… 题解列表 2023年02月12日 0 点赞 0 评论 165 浏览 评分:0.0
<循环>整数的个数(C语言) 摘要:#include<stdio.h> int main() { int k,arr[100],c1=0,c2=0,c3=0; scanf("%d", &k); for (int i = …… 题解列表 2023年02月12日 0 点赞 0 评论 156 浏览 评分:0.0
python 字符串对比解法(ascll码值) 摘要:S1=input()S2=input()if len(S1)!=len(S2): print(1)else: a=0 b=0 c=0 for i in range(len…… 题解列表 2023年02月12日 0 点赞 0 评论 165 浏览 评分:0.0
2832: 第n小的质数 建立已知质数表用来比较,减小复杂度 摘要:解题思路:注意事项: 复杂度大约是 O(n*Π(n)) ?参考代码:#include <iostream> // #include <sstream> // #include <cstdio…… 题解列表 2023年02月12日 0 点赞 0 评论 161 浏览 评分:0.0
编写题解 1777: 循环练习之完美数判断(python) 摘要:解题思路:注意事项:参考代码:if __name__ == '__main__': n = int(input()) s = [] for i in range(1,…… 题解列表 2023年02月13日 0 点赞 0 评论 225 浏览 评分:0.0
编写题解 1782: 找出最长的字符串来(python) 摘要:解题思路:注意事项:参考代码:if __name__ == '__main__': c = '' length = 0 for i in range(…… 题解列表 2023年02月13日 0 点赞 0 评论 193 浏览 评分:0.0
编写题解 1783: 星期判断机(python) 摘要:解题思路:注意事项:参考代码:if __name__ == '__main__': s = ['Monday', 'Tuesday', '…… 题解列表 2023年02月13日 0 点赞 0 评论 227 浏览 评分:0.0