Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class HT003 {
- public static void main (String args[]) {
- Scanner scan = new Scanner(System.in);
- System.out.println("Your number is: ");
- int number = scan.nextInt();
- for (int a = number; a>=2; a--) {
- //System.out.println(a);
- if (a>2) {
- System.out.print(a%2);
- }
- if (a == 2) {
- System.out.print("1");
- }
- a= ((a-(a%2))/2)+1;
- }
- System.out.println(" read your code from the bottom");
- }
- }
Add Comment
Please, Sign In to add comment