当前位置:网站首页>is_ power_ of_ 2 judge whether it is a multiple of 2
is_ power_ of_ 2 judge whether it is a multiple of 2
2022-07-03 09:59:00 【Wukong is so timid】
bool is_power_of_2(int n) {
int i,j;
if(n<=0)
return false;
if(n==1)
return true;
while(n!=1)
{
if(n%2==0)
n=n/2;
else
return false;
}
return true;
}
边栏推荐
- SSB Introduction (PbCH and DMRs need to be supplemented)
- Drive and control program of Dianchuan charging board for charging pile design
- A lottery like scissors, stone and cloth (C language)
- Fundamentals of Electronic Technology (III)__ Chapter 1 resistance of parallel circuit
- Schematic diagram and connection method of six pin self-locking switch
- Application of 51 single chip microcomputer timer
- STM32 general timer output PWM control steering gear
- 当你需要使用STM32某些功能,而51实现不了时, 那32自然不需要学
- [untitled] proteus simulation of traffic lights based on 89C51 Single Chip Microcomputer
- STM32 serial communication principle
猜你喜欢
STM32 interrupt priority management
Notes on C language learning of migrant workers majoring in electronic information engineering
应用最广泛的8位单片机当然也是初学者们最容易上手学习的单片机
SCM is now overwhelming, a wide variety, so that developers are overwhelmed
C language enumeration type
UCI and data multiplexing are transmitted on Pusch (Part V) -- polar coding
[CSDN] C1 training problem analysis_ Part II_ Web Foundation
Fundamentals of Electronic Technology (III)__ Logic gate symbols in Chapter 5
51 MCU tmod and timer configuration
Timer and counter of 51 single chip microcomputer
随机推荐
Runtime. getRuntime(). GC () and runtime getRuntime(). The difference between runfinalization()
In third tier cities and counties, it is difficult to get 10K after graduation
There is no specific definition of embedded system
SCM career development: those who can continue to do it have become great people. If they can't endure it, they will resign or change their careers
Do you understand automatic packing and unpacking? What is the principle?
Runtime.getRuntime().gc() 和 Runtime.getRuntime().runFinalization() 的区别
JS基础-原型原型链和宏任务/微任务/事件机制
自动装箱与拆箱了解吗?原理是什么?
【力扣刷题笔记(二)】特别技巧,模块突破,45道经典题目分类总结,在不断巩固中精进
Chromium Embedded Framework (CEF) 介绍
2021-01-03
yocto 技术分享第四期:自定义增加软件包支持
01仿B站项目业务架构
UCI and data multiplexing are transmitted on Pusch (Part V) -- polar coding
Windows下MySQL的安装和删除
Interruption system of 51 single chip microcomputer
IDEA远程断点调试jar包项目
Fundamentals of Electronic Technology (III)__ Logic gate symbols in Chapter 5
Assignment to '*' form incompatible pointer type 'linkstack' {aka '*'} problem solving
(2)接口中新增的方法