fork download
  1.  
  2. import java.util.*;
  3. import java.lang.*;
  4. import java.io.*;
  5.  
  6. /* Name of the class has to be "Main" only if the class is public. */
  7. class Ideone
  8. {
  9. public static void main (String[] args) throws java.lang.Exception
  10. {
  11. int[] fork = new int[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
  12.  
  13. for (int index = 0; index < fork.length; index = index + 1) {
  14.  
  15. if (fork[index] < 5) {
  16.  
  17. int more = index + 1;
  18. System.out.println ("цифра " + more + " меньше чем 5" );
  19. }
  20.  
  21. }
  22. }
  23. }
Success #stdin #stdout 0.15s 55404KB
stdin
Standard input is empty
stdout
цифра 1 меньше чем 5
цифра 2 меньше чем 5
цифра 3 меньше чем 5
цифра 4 меньше чем 5