当前位置:网站首页>11.2-hj86 find the maximum number of continuous bits
11.2-hj86 find the maximum number of continuous bits
2022-07-25 18:23:00 【syc596】
HJ86 Find the maximum continuity bit Count
Find the maximum continuity bit Count _ Niuke Tiba _ Cattle from (nowcoder.com)
import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
while(sc.hasNext()){
int n=sc.nextInt();
int count=0;
int ret=0;
while(n!=0){
if((n&1)==1){
count++;
if(count>ret){
ret=count;
}
}else{
count=0;
}
n>>=1;
}
System.out.println(ret);
}
}
}边栏推荐
- How to create an effective help document?
- One week activity express | in simple terms, issue 8; Meetup Chengdu station registration in progress
- 7. Dependency injection
- The new version of 3dcat v2.1.3 has been released. You can't miss these three function updates!
- [QNX Hypervisor 2.2用户手册]9.5 dump
- nodejs 简单例子程序之express
- [QNX Hypervisor 2.2用户手册]9.4 dryrun
- testng执行顺序的3中控制方法
- "Digital security" alert NFT's seven Scams
- php内存管理机制与垃圾回收机制
猜你喜欢

如何将exe文件添加到开机启动

Good news! Ruiyun technology was awarded the member unit of 5g integrated application special committee of "sailing on the sea"

Connect to MySQL using sqldeveloper

Oracle uses impdp import to report an error: ora-39001: invalid parameter value ora-39000: dump file description error ora-39088: file name cannot contain path description

Design practice of Netease strictly selecting inventory center

This is a quick look-up table of machine & deep learning code

BiSeNet v1

SQL things

Stm8s003f3 internal flash debugging

Could not stop Cortex-M device! please check the JTAG cable的解决办法
随机推荐
软件测试——常用的测试工具
数二2010真题考点
php内存管理机制与垃圾回收机制
C language -- 25 minesweeping game
OV7725 yuv 640* [email protected] Profile
Optimistic lock pessimistic lock applicable scenario
testng执行顺序的3中控制方法
程序的编译
工程师必看的示波器探头安全使用说明书
二叉树的相关操作
文件基础知识
Keil5 "loading PDSC debug description failed for STMicroelectronics stm32hxxxxxxx" solution
Chapter 5 Basic Scripting: Shell Variables
OV7725 yuv 640*[email protected] 配置文件
BL602 开发环境搭建
How to choose digital twin visualization platform
The new version of 3dcat v2.1.3 has been released. You can't miss these three function updates!
Pan domain name configuration method
CH582 BLE 5.0 使用 LE Coded 广播和连接
Tensor to img && imge to tensor (pytorch的tensor转换)