11.1 选择语句--switch switch语句格式: 1 switch(表达式){ 2 case 常量值1: 3 语句体1; 4 break; 5 case 常量体2; 6 语句体2; 7 break; 8 ... 9 default; 10 语句体n+1; 11 break; 12 } 执行 ...
分类:
其他好文 时间:
2020-02-08 15:18:09
阅读次数:
70
Given a string s and an integer k, find out if the given string is a K-Palindrome or not. A string is K-Palindrome if it can be transformed into a pal ...
分类:
其他好文 时间:
2020-02-08 10:14:38
阅读次数:
74
魔术方法 在python中,以双下划线开头、双下划线结尾的方法我们称之为魔术方法。例如__init__ 魔术方法是python内部定义好的,我们不需要去创建。 1.__new__方法和单例模式 __new__方法:Create and return a new object.创建对象时触发 clas ...
分类:
其他好文 时间:
2020-02-08 10:10:54
阅读次数:
121
1、Thymeleaf 目标 迭代语法:th:each; iteration status 条件语法:th:if; th:unless switch语法:th:switch; th:case; * 2、公共模拟SpringBoot 后台接口 后台逻辑(action) // 分页查询 @Request ...
分类:
其他好文 时间:
2020-02-07 22:42:20
阅读次数:
85
最近在使用python3,同样装了nose,发现自动发现用例总是有问题,如下面的代码结婚 testcase | __init__.py | test_bb.py test_bb.py中文件为: def test_qq(): pass Python3中: 再使用nose执行testcase提示: Ra ...
分类:
编程语言 时间:
2020-02-07 20:36:36
阅读次数:
75
O(n^2)的方法,最后一个case超时。需要用kmp方法或者manacher方法才能O(n),先忽略了。 class Solution: def isPalindrome(self, sub: str) -> bool: for i in range(len(sub) // 2): if sub[ ...
分类:
其他好文 时间:
2020-02-07 18:29:59
阅读次数:
48
function course(name,age){ console.log(age); //undefined 此时age并无实参,所以为undefined console.log(arguments[1]); //undefined arguments指示的age,因为下标是以0开始的 argu ...
分类:
Web程序 时间:
2020-02-07 14:34:54
阅读次数:
88
计算回文字符串最大长度模板题 如果一个字符串正着读和倒着读是一样的,则称它是回文的。 给定一个长度为N的字符串S,求他的最长回文子串的长度是多少。 输入格式 输入将包含最多30个测试用例,每个测试用例占一行,以最多1000000个小写字符的形式给出。 输入以一个以字符串“END”(不包括引号)开头的 ...
分类:
其他好文 时间:
2020-02-07 13:16:22
阅读次数:
71
1、对大学生成绩大于60分的,输出“合格”,低于60分的,输出“不合格”。使用switch-case结构,可以取模 1 package com.book.demo; 2 3 public class SwicthCase { 4 public static void main(String[] ar... ...
分类:
其他好文 时间:
2020-02-06 18:19:34
阅读次数:
105
1.示例1 查询1: SELECT CASE main_xm_sam31 WHEN '02' THEN 2 ELSE 1 END AS SPDJ FROM SR_MAIN_BG A WHERE A.PK_SR_MAIN = '1162275825622593536' AND (SYS_SPDJ = ...
分类:
数据库 时间:
2020-02-06 16:27:56
阅读次数:
69