python简单字符串两个解法 带解析 摘要:# 法1:N=int(input().strip())#输入题目Nfor i in range(N): A=input() #输入字符串 n=1 #记录相邻相同字符的个数 s = "…… 题解列表 2023年02月11日 0 点赞 0 评论 412 浏览 评分:0.0
Sn的公式求和 摘要:解题思路:注意事项:参考代码:#pragma warning(disable:4996)//vs2022用来取消scanf的报错#include<stdio.h> int main() { int …… 题解列表 2023年02月11日 0 点赞 0 评论 361 浏览 评分:0.0
定义函数判断素数 摘要:解题思路:首先了解下素数;素数是指在大于1的自然数中,除了1和它本身以外不再有其他因数的自然数。(也就是只有1跟它本身能整除掉这个数)我们可以利用for循环来判断输入的数字是否为素数。注意事项:1.注…… 题解列表 2023年02月11日 0 点赞 0 评论 366 浏览 评分:0.0
奥运奖牌计数(C语言) 摘要:#include<stdio.h> int main() { int n,sum1=0,sum2=0,sum3=0,sum,arr[50][3]; scanf("%d", &n); …… 题解列表 2023年02月11日 0 点赞 0 评论 475 浏览 评分:0.0
用C语言解决母牛的故事[递归] 摘要:#### 解题思路:递归 题目的难点在于每年出生的母牛数量是不固定的,并且是每年都存在不固定数量的母牛加入生产母牛的行列。 #### 递归思路的体现: 先去考虑每年能够增加的母牛数量,再考虑这一…… 题解列表 2023年02月11日 0 点赞 0 评论 441 浏览 评分:0.0
两种解法哪种更优?还是? 摘要:直接for循环求解 ```cpp #include #include using namespace std; int main() { int a,b; for(int i=10…… 题解列表 2023年02月11日 0 点赞 0 评论 376 浏览 评分: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 评论 321 浏览 评分:0.0
<循环>角谷猜想(C语言) 摘要:#include<stdio.h> int main() { int n,x,y; scanf("%d", &n); while (n > 0)//未知循环次数用while语句 {…… 题解列表 2023年02月12日 0 点赞 0 评论 351 浏览 评分: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 评论 494 浏览 评分: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 评论 437 浏览 评分:0.0