标签:
import java.util.Scanner; public class GetContinuous1 { public static void main(String[] args) { Scanner scan = new Scanner(System.in); byte num = scan.nextByte(); String str = Integer.toBinaryString(num); String[] strArr = str.split("0"); int len = strArr[0].length(); int d = 0; for (int i = 1; i < strArr.length; i++) { if(strArr[i].length() > len){ len = strArr[i].length(); d = i; } } System.out.println(strArr[d].length()); } }
版权声明:本文为博主原创文章,未经博主允许不得转载。
标签:
原文地址:http://blog.csdn.net/liaction/article/details/47754293