码迷,mamicode.com
首页 > 其他好文 > 详细

HW4.46

时间:2016-08-19 20:46:17      阅读:118      评论:0      收藏:0      [点我收藏+]

标签:

技术分享

 

 1 import java.util.Scanner;
 2 
 3 public class Solution
 4 {
 5     public static void main(String[] args)
 6     {
 7         Scanner input = new Scanner(System.in);
 8 
 9         System.out.print("Enter an integer: ");
10         int number = input.nextInt();
11 
12         int mask = 1;
13 
14         for(int i = 15; i > 0; i--)
15         {
16             int a = number >> i;
17             int b = a & mask;
18             System.out.print(b);
19         }
20 
21         System.out.println();
22     }
23 }

 

HW4.46

标签:

原文地址:http://www.cnblogs.com/wood-python/p/5788893.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!