题解列表

筛选

回文串-字符串处理(C++)

摘要:参考代码:#include<cstdio>#include<cstring>const int maxn = 256;   //判断字符串str是否是“回文串”bool judge(char str[……

编写题解 1231: 杨辉三角

摘要:解题思路:注意事项:参考代码:#include "stdio.h" int main() {   int n, i, j;   int a[30][30];   while (scanf("%……

Tom数(水题)

摘要:```c #include int main(){ long long n,sum,i; while(scanf("%lld",&n)!=EOF){ sum=0; ……

自定义函数处理素数

摘要:解题思路:傻瓜解法,遍历2到n注意事项:参考代码:def sushu(n): for i in range(2,n) :    if n%i==0:         print(&#39;not pr……

内码对称问题

摘要:解题思路:注意事项:参考代码:sum1 = 0try:    while True:        x=int(input())        y=format(x,&#39;b&#39;)     ……

switch语句解决成绩评定

摘要:解题思路:    题目首先提出输入不同的分数输出对应的等级,那么一定会用到选择语句(if/else if也可),那么我们就要分析switch中的语法特性,switch后跟常量,在case中找到与swi……

Minesweeper -题解(Python,暴力搜索)

摘要:## 前言 由于笔者能力问题,所以本题没有采用DFS(~~当然不是因为懒~~) 下面是代码 ## 输入 因为python语言的问题,所以每行输入可以当做一个字符数组,分别储存在列表里面。然……

淘淘的名单(C++)

摘要:解题思路:注意事项:参考代码:#include<iostream>#include<string>using namespace std;int main(){ int n=0; string a[1……

半数集问题

摘要:解题思路:注意事项:参考代码:from functools import lru_cache@lru_cache(maxsize=1024)def DFS(n):    sum1 = 1    for……