题解列表

筛选

字符与ascll码值的转换

摘要:解题思路:注意事项:补充题解中Python代码空缺参考代码:print(ord("t"))print(chr(63))……

二叉树遍历(python)

摘要:解题思路:注意事项:参考代码:# 定义树节点的数据结构class TreeNode:    def __init__(self, val):        self.val = val        ……

题解 2914: 铺地毯

摘要: #include using namespace std; const int N=10010; int a[N],b[N],g[N],k[N]; in……

简单易懂的答案

摘要:解题思路:注意事项:参考代码:#include<stdio.h>void paixu(int array[]){     int i;     int j;     int k;     for(i ……

题解 2000 偶数列举

摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int main(){    int n;    cin>>n;    for(i……

题解 2816: 统计满足条件的4位数个数

摘要:解题思路:先定义并输入n个数,再定义sum=0,再写循环并在循环里求出四位的数,再让他们进行运算,如果大于零就累加sum,最后输出sum。注意事项:要定义sum=0。参考代码:#include <bi……

确定区间,找第一个左大右小,让count++

摘要:解题思路:定义两个指针l,r分别表示区间的两端 定义hasSmaller方法 如果l,r指向的字符满足左大右小,返回1表示找到这样一个符合条件的区间 如果l,r指向的字符恰好相等,则将l++,r……

1147: C语言训练-角谷猜想

摘要:解题思路:不为1持续循环注意事项:参考代码:n = int(input())while n != 1:    if n % 2 == 0:        print("%d/2=%d" %(n,n /……