mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-09 12:11:28 +08:00
reduce code
This commit is contained in:
@ -39,15 +39,11 @@ public class Armstrong {
|
|||||||
sum = sum + (remainder * remainder * remainder);
|
sum = sum + (remainder * remainder * remainder);
|
||||||
number = number / 10;
|
number = number / 10;
|
||||||
}
|
}
|
||||||
if (sum == temp) {
|
return sum == temp;
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int inputInt(String string) {
|
private static int inputInt(String string) {
|
||||||
System.out.print(string);
|
System.out.print(string);
|
||||||
return Integer.parseInt(scan.nextLine());
|
return Integer.parseInt(scan.nextLine());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user