about summary refs log tree commit diff
path: root/usth/ICT2.2/labwork/1/Binary.java
blob: 3573a35c3bcc2b6a57d0ec3fac9f0857ee0a744b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class Binary
{
  public static void main(String... args)
  {
    int n = Integer.parseInt(args[0]);
    String s = "";
    while (n > 0)
      {
        s = (n % 2) + s;
        n >>= 1;
      }
    System.out.println(s);
  }
}