summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2015-01-13 23:05:12 +0300
committerIgor Pashev <pashev.igor@gmail.com>2015-01-13 23:05:12 +0300
commit4d6e87e60dbda085bfab00be365c087932edec52 (patch)
tree67c2c2346f6cb3abd7044746823c33364fec30b6
parentec540fa25cf63ad27efe718680637957f7b9e154 (diff)
downloadgcd-4d6e87e60dbda085bfab00be365c087932edec52.tar.gz
java: no numbers, no crash
-rw-r--r--gcd.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcd.java b/gcd.java
index abc505f..82722a1 100644
--- a/gcd.java
+++ b/gcd.java
@@ -29,6 +29,8 @@ public class gcd
}
public static void main(String [] argv) {
+ if (argv.length == 0)
+ return;
int [] n = new int [argv.length];
for (int i = 0; i < argv.length; i++) {
n[i] = Integer.parseInt(argv[i]);