Guest User

Untitled

a guest
May 27th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. public class Aufgabe4 {
  2. public static void main (String args[]) {
  3. IO.println("Gebe eine Zahl ein:");
  4. int zahl = IO.readInt();
  5. dualzahl(int zahl);
  6. }
  7.  
  8. public static void dualzahl(int zahl) {
  9. if(zahl == 1)
  10. return zahl;
  11. else {
  12. IO.print(zahl / 2);
  13. dualzahl(zahl % 2);
  14. }
  15. }
  16. }
Add Comment
Please, Sign In to add comment