This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
输入任意数字,求该数二进制表达中有多少个1。 | |
例如:输入10,由于其二进制表示为1010,有两个1,因此输出2 | |
PS: | |
1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。 | |
```javascript | |
// you code | |
``` | |
2. 粘贴代码时请使用shift+tab,缩进前面的空白。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
验证邮箱合法性。规则如下,欢迎补充。 | |
1 必须为英文,不能是中文,必须为英文开始(以数字开头规则在六条),且用户名长度为6-25,即为@前长度 | |
2 包含@, .两个字符,@在点之前,@不能是首尾 | |
3 包含常用域名,如 163, 126,qq,Gmail,outlook | |
4 以.com, .org, .cn, .me 等结尾 | |
5 首尾,中间不能有空格 | |
6 如果名字以数字开头,则必为11位,且全为数字,即为常见手机号码的邮箱,如:13,15,开头的[email protected] | |
PS: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
输入两个整数n和m,从数列1,2,3......n中随意取几个数, | |
使其和等于m,输出其中所有的可能组合。 | |
PS: | |
1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。 | |
```javascript | |
// you code | |
``` | |
2. 粘贴代码时请使用shift+tab,缩进前面的空白。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n个数字(0,1,...,n-1)形成一个圆圈,从数字0开始, | |
每次从这个圆圈中删除第m个数字(第一个为当前数字本身,第二个为当前数字的下一个数字), | |
当一个数字删除后,从被删除数字的下一个继续删除第m个数字, | |
求出这个圆圈中剩下的最后一个数字 | |
PS: | |
1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。 | |
```javascript | |
// you code | |
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
有一种细胞,经过一分钟分裂为2个,再过一分钟,分裂为4个, | |
这样,将一个细胞放在一个瓶子里面,一个小时后瓶子被细胞充满了。 | |
现在假设一开始放入瓶中的为两个细胞,那么到充满瓶子要多长的时间? | |
PS: | |
1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。 | |
```javascript | |
// you code | |
``` | |
2. 粘贴代码时请使用shift+tab,缩进前面的空白。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
根据input输入情况,检验密码的强度,规则如下: | |
1. 纯数字,纯字母为:弱。 | |
2. 数字与字母组合为:中。 | |
3. 数字,字母,特殊字符@#$%^&*_+[]{}组合为:强。 | |
4. 以上长度必为8位以上。 | |
PS: | |
1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。 | |
```javascript | |
// you code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
请实现javascript 1.8的filter方法 | |
PS: | |
1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。 | |
```javascript | |
// you code | |
``` | |
2. 粘贴代码时请使用shift+tab,缩进前面的空白。 | |
3. 今天只来一发。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript里typeof返回的结果有哪几种? | |
PS: | |
1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。 | |
```javascript | |
// you code | |
``` | |
2. 粘贴代码时请使用shift+tab,缩进前面的空白。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
如何将颜色值十六进制,RGB相互转换? | |
如:#ffffff转换为:RGB(255,255,255) | |
RGB(23, 245, 56)转换为:#17f538 | |
PS: | |
1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。 | |
```javascript | |
// you code | |
``` | |
2. 粘贴代码时请使用shift+tab,缩进前面的空白。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
如何实现以下代码: | |
[1,2,3,4,5].copy(); // [1,2,3,4,5,1,2,3,4,5] | |
PS: | |
1. 回复时注意加上下面这句话,才会有语法高亮或格式缩进。 | |
```javascript | |
// you code | |
``` | |
2. 粘贴代码时请使用shift+tab,缩进前面的空白。 |