Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Aufgabe4 {
- public static void main (String args[]) {
- IO.println("Gebe eine Zahl ein:");
- int zahl = IO.readInt();
- dualzahl(int zahl);
- }
- public static void dualzahl(int zahl) {
- if(zahl == 1)
- return zahl;
- else {
- IO.print(zahl / 2);
- dualzahl(zahl % 2);
- }
- }
- }
Add Comment
Please, Sign In to add comment