当前位置:网站首页>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);
}
}
}边栏推荐
- 图的相关操作
- "Deprecated gradle features were used in this build, making it incompatible with gradle 6.0" problem solving
- 想要做好软件测试,可以先了解AST、SCA和渗透测试
- 柔性电流探头选型指南
- 数二2010真题考点
- srec_cat 常用参数的使用
- 网易严选库存中心设计实践
- Uniapp scroll bar topping effect, customized page scroll bar position (sorting)
- Bl602 development environment setup
- One week activity express | in simple terms, issue 8; Meetup Chengdu station registration in progress
猜你喜欢

Oracle使用impdp导入报错:ORA-39001: 参数值无效 ORA-39000: 转储文件说明错误 ORA-39088: 文件名不能包含路径说明

Circulaindicator component, which makes the indicator style more diversified

7. Dependency injection

Combined with GHS multi, use Reza E1 simulator to realize the simulation and debugging of Reza rh850 single chip microcomputer

Problems faced by cloud XR and main application scenarios of cloud XR

BiSeNet v1

软件测试——常用的测试工具

使用sqldeveloper连接mysql

The new version of 3dcat v2.1.3 has been released. You can't miss these three function updates!

Tang's little helper
随机推荐
STM32F105RBT6 内部flash调试
Connect to MySQL using sqldeveloper
Detailed explanation of super full mavan label
Stm8s003f3 internal flash debugging
Compilation of program
文件基础知识
Taishan Office Technology Lecture: conversion relations of inch, centimeter, pound, pika, Ti, line, word line and pixel
11.2-HJ86 求最大连续bit数
乐观锁解析
One week activity express | in simple terms, issue 8; Meetup Chengdu station registration in progress
Experimental reproduction of image classification (reasoning only) based on caffe resnet-50 network
imx6 RTL8189FTV移植
The new version of 3dcat v2.1.3 has been released. You can't miss these three function updates!
Unittest framework application
Tensor to img & imge to tensor (tensor conversion of pytorch)
Use of C language cjson Library
Diagonalization, power of a
程序的编译
Safe operation instructions for oscilloscope probe that must be read by engineers
tkinter GUI版通信录管理系统