From b98e8d9ae90b474c3da12e297fe3af08dd2695f2 Mon Sep 17 00:00:00 2001 From: shellhub Date: Mon, 23 Sep 2019 14:49:23 +0800 Subject: [PATCH] reduce code --- Others/Armstrong.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Others/Armstrong.java b/Others/Armstrong.java index 1340c8b9..bfdde2b0 100644 --- a/Others/Armstrong.java +++ b/Others/Armstrong.java @@ -39,15 +39,11 @@ public class Armstrong { sum = sum + (remainder * remainder * remainder); number = number / 10; } - if (sum == temp) { - return true; - } else { - return false; - } + return sum == temp; } private static int inputInt(String string) { System.out.print(string); return Integer.parseInt(scan.nextLine()); } -} \ No newline at end of file +}