Python解统计字符 摘要:解题思路:注意事项:参考代码:n = input()a = 0b = 0c = 0d = 0for i in n: if (i>='a' and i<='z') …… 题解列表 2023年02月10日 0 点赞 0 评论 433 浏览 评分:0.0
Python统计数字字符个数 摘要:解题思路:注意事项:参考代码:n=input()count=0for i in n: if i>='0' and i<='9': count+=1p…… 题解列表 2023年02月10日 0 点赞 0 评论 500 浏览 评分:0.0
2124: 信息学奥赛一本通T1259-求最长不下降序列 摘要:解题思路:注意事项:参考代码:#include<iostream> #include<cstring> #include<cmath> #include<algorithm> #include…… 题解列表 2023年02月11日 0 点赞 0 评论 491 浏览 评分:0.0
记录一下排列的题解 摘要:不会设置成仅自己可见捏参考代码:#include<stdio.h>int main(){ int num[4]; int i,j,m,k; for(i=0;i<4;i++) { scanf("…… 题解列表 2023年02月11日 0 点赞 0 评论 350 浏览 评分:0.0
python简单字符串两个解法 带解析 摘要:# 法1:N=int(input().strip())#输入题目Nfor i in range(N): A=input() #输入字符串 n=1 #记录相邻相同字符的个数 s = "…… 题解列表 2023年02月11日 0 点赞 0 评论 404 浏览 评分:0.0
Sn的公式求和 摘要:解题思路:注意事项:参考代码:#pragma warning(disable:4996)//vs2022用来取消scanf的报错#include<stdio.h> int main() { int …… 题解列表 2023年02月11日 0 点赞 0 评论 353 浏览 评分:0.0
定义函数判断素数 摘要:解题思路:首先了解下素数;素数是指在大于1的自然数中,除了1和它本身以外不再有其他因数的自然数。(也就是只有1跟它本身能整除掉这个数)我们可以利用for循环来判断输入的数字是否为素数。注意事项:1.注…… 题解列表 2023年02月11日 0 点赞 0 评论 359 浏览 评分: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 评论 460 浏览 评分:0.0
用C语言解决母牛的故事[递归] 摘要:#### 解题思路:递归 题目的难点在于每年出生的母牛数量是不固定的,并且是每年都存在不固定数量的母牛加入生产母牛的行列。 #### 递归思路的体现: 先去考虑每年能够增加的母牛数量,再考虑这一…… 题解列表 2023年02月11日 0 点赞 0 评论 433 浏览 评分:0.0
两种解法哪种更优?还是? 摘要:直接for循环求解 ```cpp #include #include using namespace std; int main() { int a,b; for(int i=10…… 题解列表 2023年02月11日 0 点赞 0 评论 370 浏览 评分:0.0