022(n>0 && ((n & (n-1)) == 0)) (keep it up)

以下代码的作用:

(n>0 && ((n & (n-1)) == 0))

很简单:判断n是否为2的整数次幂


写程序计算从整数A变为整数B需要修改的二进制位数。
输入:31,14
输出:2

这个题也很简单:A和B异或然后再算结果中1的个数

代码:

int getModifyNum(const int vA, const int vB)
{
	int Tmp = vA ^ vB;
	int Count = 0;
	while (Tmp > 0)
	{
		if (Tmp & 1) ++Count;
		Tmp >>= 1;
	}
	return Count;
}


请帮我翻译 Starting Nmap 7.93 ( https://nmap.org ) at 2023-06-08 15:58 CST Pre-scan script results: | broadcast-avahi-dos: | Discovered hosts: | 224.0.0.251 | After NULL UDP avahi packet DoS (CVE-2011-1002). |_ Hosts are all up (not vulnerable). Nmap scan report for MiWiFi-RA72-srv (192.168.31.244) Host is up (0.026s latency). Not shown: 995 closed tcp ports (reset) PORT STATE SERVICE 80/tcp open http |_http-csrf: Couldn't find any CSRF vulnerabilities. |_http-dombased-xss: Couldn't find any DOM based XSS. |_http-stored-xss: Couldn't find any stored XSS vulnerabilities. | http-slowloris-check: | VULNERABLE: | Slowloris DOS attack | State: LIKELY VULNERABLE | IDs: CVE:CVE-2007-6750 | Slowloris tries to keep many connections to the target web server open and hold | them open as long as possible. It accomplishes this by opening connections to | the target web server and sending a partial request. By doing so, it starves | the http server's resources causing Denial Of Service. | | Disclosure date: 2009-09-17 | References: | https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-6750 |_ http://ha.ckers.org/slowloris/ 443/tcp open https |_http-dombased-xss: Couldn't find any DOM based XSS. |_http-csrf: Couldn't find any CSRF vulnerabilities. |_http-stored-xss: Couldn't find any stored XSS vulnerabilities. 631/tcp open ipp 8080/tcp open http-proxy 9100/tcp open jetdirect MAC Address: 6C:02:E0:20:74:2A (HP) Nmap done: 1 IP address (1 host up) scanned in 193.99 seconds
最新发布
06-09
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值