From 153b9fe1cb62b88d5106c205b091372a0eacf665 Mon Sep 17 00:00:00 2001 From: JeonSeongBae Date: Tue, 19 Dec 2017 19:30:46 +0900 Subject: [PATCH 1/2] add closeing the scanner --- Others/FibToN.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Others/FibToN.java b/Others/FibToN.java index e7b7a9a23..1d1efdc1e 100644 --- a/Others/FibToN.java +++ b/Others/FibToN.java @@ -9,7 +9,7 @@ public class FibToN { // print fibonacci sequence less than N int first = 0, second = 1; //first fibo and second fibonacci are 0 and 1 respectively - + scn.close(); while(first <= N){ //print first fibo 0 then add second fibo into it while updating second as well From 1e38751a6b840895c03b5c13c2db05aac7b1d3a9 Mon Sep 17 00:00:00 2001 From: JeonSeongBae Date: Tue, 19 Dec 2017 19:32:50 +0900 Subject: [PATCH 2/2] add closing the scanner --- Others/FloydTriangle.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Others/FloydTriangle.java b/Others/FloydTriangle.java index 815dbd292..f8d479a8d 100644 --- a/Others/FloydTriangle.java +++ b/Others/FloydTriangle.java @@ -6,7 +6,7 @@ class FloydTriangle { Scanner sc = new Scanner(System.in); System.out.println("Enter the number of rows which you want in your Floyd Triangle: "); int r = sc.nextInt(), n = 0; - + sc.close(); for(int i=0; i < r; i++) { for(int j=0; j <= i; j++) { System.out.print(++n + " ");