diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2015-01-13 23:05:12 +0300 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2015-01-13 23:05:12 +0300 |
commit | 4d6e87e60dbda085bfab00be365c087932edec52 (patch) | |
tree | 67c2c2346f6cb3abd7044746823c33364fec30b6 | |
parent | ec540fa25cf63ad27efe718680637957f7b9e154 (diff) | |
download | gcd-4d6e87e60dbda085bfab00be365c087932edec52.tar.gz |
java: no numbers, no crash
-rw-r--r-- | gcd.java | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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]); |