Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.30 KB | None | 0 0
  1. public class Ehepaar
  2. {
  3.     public static void main(String[] args)
  4.     {
  5.         int boys  = 0;
  6.         int girls = 0;
  7.  
  8.         while(boys < 1 || girls < 1)
  9.         {
  10.             if(Math.random() > 0.5)
  11.                 boys++;
  12.             else
  13.                 girls++;
  14.         }
  15.  
  16.         System.out.println("Boys:  " + boys);
  17.         System.out.println("Girls: " + girls);
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement