流感传染(用深度优先做,这题深搜里应该也会有) 解题思路:这题与那个细菌的繁殖和扩散很相似,用深搜,上下左右四个方向遍历一下,每天在一个方向只传染一个人,建两个数组,第一个数组存每天传染前,第二个数组存传染后,以免遍历的时候出现今天刚被传染的又在今天传染了别人,一天过后更新第一个数组要注意最后输出的结果是第m天开始时, 题解列表 2023年12月15日 0 点赞 0 评论 765 浏览 评分:0.0
题解 1200: 回文串 摘要: #include using namespace std; char s[100000]; int main(){ cin>>s; int…… 题解列表 2023年12月15日 0 点赞 0 评论 483 浏览 评分:0.0
1200: 回文串C++ 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;const int N=10200;char s[N];int main(){ ci…… 题解列表 2023年12月15日 0 点赞 0 评论 530 浏览 评分:0.0
题解 2853: 字符替换 摘要: #include using namespace std; char a[20000],b,c,d,n; int main(){ cin>…… 题解列表 2023年12月15日 0 点赞 0 评论 419 浏览 评分:0.0
2853: 字符替换 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;const int N=10200;char s[N],a,b;int main()…… 题解列表 2023年12月15日 0 点赞 0 评论 418 浏览 评分:0.0
题解 2866: 过滤多余的空格 #includeusingnamespacestd;chara[20000],b,c,d,n,s[2000];intmain(){while(cin>>s)cout 题解列表 2023年12月15日 0 点赞 0 评论 491 浏览 评分:0.0
c代码记录之自定义函数连接字符串-指针--Mark:strcat函数,用于连接字符串 代码1:用getchar()#includeintmain(){charget_char;while((get_char=getchar())!=EOF){if(get_char=='\n')continue;putchar(get_char);}return0;}代码2:用gets(), 题解列表 2023年12月15日 0 点赞 0 评论 495 浏览 评分:0.0
2950: 素数回文数的个数 Python简单实现 摘要:解题思路:分别判断是否为素数和回文判断回文的思路是,将整数转换为字符串,然后判断字符串的长度,依次比较首位和末位的值是否相等即可参考代码:# 判断是否为素数 def Prime(x): f…… 题解列表 2023年12月15日 0 点赞 0 评论 642 浏览 评分:0.0
找树根和孩子(python) 摘要:解题思路:注意事项:参考代码:def find_root(tree): # 找到根节点 nodes = set(tree.keys()) children = set() fo…… 题解列表 2023年12月15日 0 点赞 0 评论 502 浏览 评分:0.0
1020: [编程入门]猴子吃桃的问题 摘要:解题思路:注意事项:参考代码:#include <stdio.h>int main(void){ unsigned sum = 1; int N; scanf("%d", &N); for (int …… 题解列表 2023年12月15日 0 点赞 0 评论 427 浏览 评分:0.0