Skip to content

Commit 1ee036e

Browse files
파라메터 수가 잘못된 경우메시지 출력및 프로그램 종료 수정
입력된 수가 없을 경우 경고 메시지 출력및 프로그램 종료 GDG-Korea#19 Signed-off-by: Jongsoo Lee <[email protected]>
1 parent d335260 commit 1ee036e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Fibonacci.java

+5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
public class Fibonacci{
44

55
public static void main(String []args){
6+
if (args.length != 1) {
7+
System.out.println("USAGE: java Fibonacci <number>");
8+
9+
return;
10+
}
611
int start = Integer.parseInt(args[0]);
712
BigInteger fib1 = new BigInteger("0");
813
BigInteger fib2 = new BigInteger("1");

0 commit comments

Comments
 (0)