Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class umwandler {
- public static void main(String[]args){
- int zaehler = 3;
- int dezimalzahl = Integer.parseInt(args[0]);
- int counter = 0;
- int rest = 0;
- while (dezimalzahl >=1){
- rest = dezimalzahl%2;
- dezimalzahl =dezimalzahl/2;
- counter++;
- }
- rest = 0;
- int array[] = new int[counter];
- while (dezimalzahl > 1){
- dezimalzahl =dezimalzahl/2;
- array [zaehler] = dezimalzahl%2;
- zaehler--;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement