热门图集
最近更新
什么是 PowerShell?
PowerShell 是一种跨平台的任务自动化解决方案,由命令行 shell、脚本语言和配置管理框架组成。 PowerShell 在 Windows、Linux 和 macOS 上运行。命令行 ShellPowerShell 是新式命令 shell,其中包括其他常用 shell 的最佳功能。 与大多数仅接受并返回文本的 shell 不同,PowerShell 接受并返回 .NET 对象。 shel
判断 num 是不是 2 的指数倍
如何判断:如果 num 是 2^n (n是自然数) ,那么 num 可以不断的整除 2,直到 num = 1; 16;16/2=8;8/2=4;4/2=2;2/2=1; 24;24/2=12;12/2=6;6/2=3;3/2 不整除#include <stdio.h>#include <stdbool.h>bool is_power_two(int n)