Guest User

Untitled

a guest
Jun 17th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class HT003 {
  4. public static void main (String args[]) {
  5. Scanner scan = new Scanner(System.in);
  6. System.out.println("Your number is: ");
  7. int number = scan.nextInt();
  8. for (int a = number; a>=2; a--) {
  9. //System.out.println(a);
  10. if (a>2) {
  11. System.out.print(a%2);
  12. }
  13. if (a == 2) {
  14. System.out.print("1");
  15. }
  16. a= ((a-(a%2))/2)+1;
  17. }
  18. System.out.println(" read your code from the bottom");
  19. }
  20.  
  21. }
Add Comment
Please, Sign In to add comment