本题考察的是回溯算法,可以使用DFS解决问题。 C++版本 #include <iostream> #include <vector> using namespace std; int getDigitSum(int num){ int sum = 0; while(num > 0){ sum += ...
分类:
其他好文 时间:
2020-07-17 11:28:13
阅读次数:
48
大于 > 小于 < 大于等于 >= 小于等于 <= 相等 == //两个等号连写才是相等,一个等号代表 赋值。 不相等 != sout...................(10>5); int num1 = 10; int num2 = 12; sout..................(num ...
分类:
其他好文 时间:
2020-07-17 09:22:04
阅读次数:
68
Saltstack是一个服务器基础架构集中化管理平台,具备配置管理、远程执行、监控等功能,可以理解为简化版的puppet,它基于python语言实现,结合轻量级消息队列(ZeroMQ)与python第三方模块构建。
分类:
其他好文 时间:
2020-07-17 01:20:39
阅读次数:
200
1:与c语言相同,定义一个下标从0开始遍历 for(int i=0 ; i<a.length() ; i++){ System.out.print(a[i]+ " "); } 2: 定义一个num作为数组nums的其中一个元素,输出时便会自动从头到尾遍历 for ( int num :nums ) ...
分类:
编程语言 时间:
2020-07-16 18:29:03
阅读次数:
71
css中:focus-within是什么 在css中 :focus-within 是一个伪类,现在已经被列入到css选择器中(css Level 4 selector)。css中伪类:focus-within能非常方便处理获取焦点状态, 当元素本身或其后代获得焦点时,:focus-within伪类的 ...
分类:
Web程序 时间:
2020-07-16 18:25:07
阅读次数:
80
上一篇我们学会了如何使用Spring Boot使用进程内缓存在加速数据访问。可能大家会问,那我们在Spring Boot中到底使用了什么缓存呢? 在Spring Boot中通过@EnableCaching注解自动化配置合适的缓存管理器(CacheManager),Spring Boot根据下面的顺序 ...
分类:
编程语言 时间:
2020-07-16 12:27:53
阅读次数:
402
1. 执行 npm install , C:\Program Files\nodejs\MyBook>npm installnpm notice created a lockfile as package-lock.json. You should commit this file. npm WAR ...
分类:
Web程序 时间:
2020-07-16 12:27:14
阅读次数:
188
bitset优化莫队。 由于bitset并不能存可重集,所以我们考虑给每种元素在bitset里留 \(k\) 个位置(\(k\) 为这种元素的个数)。我们只需要在离散化的时候不去重,然后把 \(p\) 放进bitset中第 \(p-cnt_p\) 个位置就行了(\(cnt_p\) 为bitset当前 ...
分类:
其他好文 时间:
2020-07-16 12:21:23
阅读次数:
64
NodeJs开发之三: package.json和Package_lock.json ...
分类:
Web程序 时间:
2020-07-16 12:18:18
阅读次数:
86
sql查询语句优化 1、对查询进行优化,应尽量避免全表扫描 a、 where 及 order by 涉及的列上建立索引 b、 尽量避免在 where 子句中对字段进行 null 值判断,可以将null值设置默认值0等,如:将select id from t where num is null变为se ...
分类:
数据库 时间:
2020-07-16 12:10:58
阅读次数:
81