Format code with prettier (#3375)

This commit is contained in:
acbin
2022-10-03 17:23:00 +08:00
committed by GitHub
parent 32b9b11ed5
commit e96f567bfc
464 changed files with 11483 additions and 6189 deletions

View File

@@ -18,11 +18,10 @@ public class DudeneyNumber {
if (cube_root * cube_root * cube_root != n) {
return false;
}
int sum_of_digits = 0;// Stores the sums of the digit of the entered number
int temp = n;//A temporary variable to store the entered number
int sum_of_digits = 0; // Stores the sums of the digit of the entered number
int temp = n; //A temporary variable to store the entered number
// Loop to calculate sum of the digits.
while (temp > 0) {
// Extracting Last digit of the number
int rem = temp % 10;
@@ -33,7 +32,7 @@ public class DudeneyNumber {
temp /= 10;
}
//If the cube root of the number is not equal to the sum of its digits we return false.
//If the cube root of the number is not equal to the sum of its digits we return false.
if (cube_root != sum_of_digits) {
return false;
}
@@ -47,7 +46,9 @@ public class DudeneyNumber {
* 125 Output - It is not a Dudeney Number.
*/
public static void main(String args[]) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BufferedReader br = new BufferedReader(
new InputStreamReader(System.in)
);
System.out.println("Enter a Number: ");
int n = Integer.parseInt(br.readLine());
if (isDudeney(n)) {