fork(1) download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4.  
  5. class Ideone {
  6.  
  7. public static void main (String[] args) throws java.lang.Exception {
  8. for(int i = 0; i < 10; i++) {
  9. System.out.print(getOneOrThree() + " ");
  10. }
  11. }
  12.  
  13. public static int getOneOrThree() {
  14. Random random = new Random();
  15. boolean isOne = random.nextBoolean();
  16. if (isOne) return 1;
  17. else return 3;
  18. }
  19. }
Success #stdin #stdout 0.04s 711168KB
stdin
Standard input is empty
stdout
1 3 3 1 1 1 3 3 3 1