知识点 Scanner 首先, System.in 是一个 inputstream, 我们要操作它并不容易, 所以要套一层 scanner, scanner 是可迭代的, 然后可以通过 nextInt() 等方法获取下一个输入的单词,数字等. 既然是迭代的, Scanner 还可以设置分隔符, 默认 ...
分类:
其他好文 时间:
2020-05-23 09:50:11
阅读次数:
49
1.hashmap ,初始长度为16 2.mysql行转列 初始,如下 要求查询之后结果如下 SQL语句: select xm, SUM(case kecheng when '语文' then fenshu else 0 end) as '语文', SUM(case kecheng when '数学 ...
分类:
其他好文 时间:
2020-05-22 19:26:35
阅读次数:
51
在有很多的if-then-else语句的情况下,go语言可以写成: package main import ( "fmt" "time" ) func main() { t := time.Now() switch true{ case t.Hour() < 12: fmt.Println("Goo ...
分类:
其他好文 时间:
2020-05-22 17:22:15
阅读次数:
63
互交反馈 export function myAlert(e,text,icon,mask){ if(!icon){icon="none"} switch (e) { case 0: uni.showToast({//消息提示框。 title:text, mask:mask, icon:icon, ...
分类:
其他好文 时间:
2020-05-22 17:04:25
阅读次数:
63
1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <ctype.h> 4 #include <string.h> 5 typedef int ElemType; 6 typedef struct stack{ 7 ElemType *item ...
分类:
编程语言 时间:
2020-05-22 12:50:08
阅读次数:
41
D14 case语句是多级的if...then...else...fi语句很好的替代方式。它可以让一个条件与多个模式相比较,而且case语句的读写比较方便。 语法: case EXPRESSION in PATTERN1 ) CONSEQUENT-COMMANDS ;; #必须使用 PATTERN2 ...
分类:
系统相关 时间:
2020-05-22 12:48:23
阅读次数:
61
Description Given an array A of integers, return the number of (contiguous, non empty) subarrays that have a sum divisible by K. Example 1: Note: 1 思路 ...
分类:
编程语言 时间:
2020-05-22 12:29:23
阅读次数:
47
按键可以用按键扫描的方法和外部中断的方法。 外部中断看前面,个人推荐使用外部中断更好。 其余情况可以用按键扫描,这里只讲按键扫描的方法。 先在main.h中定义按键名称 #define KEY0 HAL_GPIO_ReadPin(GPIOC,GPIO_PIN_5) //KEY0按键PC5 #defi ...
分类:
其他好文 时间:
2020-05-22 09:35:56
阅读次数:
124
Python 字符串内置函数(一) '''可以通过dir(s)查看 其中s为字符串'''s = "heLLo WoRld!"# 查看字符串s内置函数print(dir(s))'''运行结果中的主要函数:['capitalize', 'casefold', 'center', 'count', 'en ...
分类:
编程语言 时间:
2020-05-22 00:04:34
阅读次数:
56
iter: def iter(source, sentinel=None): # known special case of iter """ iter(iterable) -> iterator iter(callable, sentinel) -> iterator Get an iterato ...
分类:
编程语言 时间:
2020-05-21 21:16:23
阅读次数:
88