poj 1426

来源:互联网 发布:百度网盘显示网络异常1 编辑:程序博客网 时间:2024/05/21 09:46
import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;import java.math.BigInteger;public class Main1426 {/** * @param args * @throws IOException  * @throws NumberFormatException  */public static void main(String[] args) throws NumberFormatException, IOException {BigInteger a,b;BufferedReader stdin=new BufferedReader(new InputStreamReader(System.in));long c=0,d=0,n=0;while((n=Long.parseLong(stdin.readLine()))!=0){b=new BigInteger(1+"");d=1;while(true){c=Long.parseLong(Long.toBinaryString(d));//以二进制无符号整数形式返回d 参数的字符串表示形式。if(c%n==0)break;d++;}System.out.println(Long.toBinaryString(d));}}}

原创粉丝点击