fork download
  1. public class Main
  2. {
  3. private static String[] msg={" - Jest parzysta."," - Nie Jest parzysta."};
  4. public static void main(String[] args)
  5. {
  6. args = new String[1];
  7. args[0] = "-1";
  8. try { System.out.println("Liczba : "+args[0]+msg[Integer.parseInt(args[0])%2]); }
  9. catch (NumberFormatException e) { System.err.println(args[0]+" - nie jest liczbą typu int !!"); } // EDIT: poprawiono wg uwagi poniżej.
  10. }
  11. }
  12.  
  13.  
Runtime error #stdin #stdout 0.07s 380224KB
stdin
Standard input is empty
stdout
Standard output is empty