ICode9

精准搜索请尝试: 精确搜索
  • 958. 二叉树的完全性检验2022-01-14 12:01:47

    #这个代码无法通过,我觉得我写复杂了,所以这个代码不要再修修补补了 #直接换个思路 def fun1(root): ''' 验证是否为完全二叉树 完全二叉树的定义: 除最后一层外,每一层一定都是满的 最后一层若不满,则为是从左往右依次排列

  • Leetcode/数学/计数质数2021-04-24 19:32:49

    质数的算法: 1,判断n是否能被2~n-1整除 输入的数n不能被2-(n-1)整除,说明是素数 输入的数n能被2-(n-1)整除,说明不是素数 #include<stdio.h> int main() { int i, n; bool i; printf("please input a number:"); scanf("%d", &n); for (i = 2; i < n ; i++) {

  • p1706 全排列2021-02-06 06:01:15

    #include <iostream> #include <cstdio> #include<iomanip> using namespace std; int b[9]; int ans; int n; int panduan(int a[], int n)//1不在,0在 { bool x = 1; for (int i = 1; i <= sizeof(a); i++) { if (a[i] == n)

  • 1413.C语言合法标识符2021-01-01 13:02:14

    题目描述 输入一个字符串,判断其是否是C的合法标识符。 输入 输入一个长度不超过50的字符串。 输出 如果输入数据是C的合法标识符,则输出"yes",否则,输出“no”。 样例输入 8fixafghgjhjhjyuyuyyuyuyu 样例输入 no 样例输出 #include <stdio.h> #include <stdlib.h> #include <

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有