public class BinaryCreater {
//2^10 = 1024 により、1000までならサイズ10でおけ
private final int MAXIMAM_SIZE=10;
public static void main(String[] args) {
BinaryCreater bc = new BinaryCreater();
while(true){
System.out.println("番号をいれてくれだされ キー坊殿:");
try{
String target = bc.getLine();
public class Binary {
public static void main(String[] args)throws IOException{
int[] list = new int[10];
try{
System.out.println("1~1000の数字を入力して下さい。");
BufferedReader br =
new BufferedReader(new InputStreamReader(System.in));
int num = Integer.parseInt(br.readLine());
//1〜1000の間であることをチェック♪
if(num > 0 && num <= 1000){
//一応入力された数字を確認表示
System.out.println(num);
//配列のおしりから順に数値を入れていく。
for(int i=list.length-1;i>=0;i--){
if(num<2){
list[i] = num;
num = 0;
}else{
list[i] = num%2;
num /= 2;
}
}