1. public class naloga_3 {
  2. public static void main(String[] args) {
  3. int[][] stevila = new int[2][20];
  4. String niz = new String();
  5. int stevilo;
  6.  
  7. for(int i = 0; i < stevila[0].length; i++) {
  8. try {
  9. niz = javax.swing.JOptionPane.showInputDialog("Vpiši celo število!");
  10. stevilo = Integer.valueOf(niz).intValue();
  11. } catch(Exception e) {
  12. continue;
  13. }
  14.  
  15. if(stevilo % 2 == 0) {
  16. stevila[0][i] = stevilo;
  17. } else {
  18. stevila[1][i] = stevilo;
  19. }
  20. }
  21.  
  22. for(int i = 0; i < stevila.length; i++) {
  23. if(i == 0) {
  24. System.out.print("soda |");
  25. } else if(i == 1) {
  26. System.out.print("liha |");
  27. }
  28.  
  29. for(int j = 0; j < stevila[i].length; j++) {
  30. System.out.format("%2d ", stevila[i][j]);
  31. }
  32. System.out.println();
  33. }
  34.  
  35. System.exit(0);
  36. }
  37. }