style: format code (#4212)

close #4204
This commit is contained in:
acbin
2023-06-09 18:52:05 +08:00
committed by GitHub
parent ad03086f54
commit 00282efd8b
521 changed files with 5233 additions and 7309 deletions

View File

@ -10,7 +10,7 @@ import java.io.*;
public class DudeneyNumber {
//returns True if the number is a Dudeney number and False if it is not a Dudeney number.
// returns True if the number is a Dudeney number and False if it is not a Dudeney number.
public static boolean isDudeney(int n) {
// Calculating Cube Root
int cube_root = (int) (Math.round((Math.pow(n, 1.0 / 3.0))));
@ -19,7 +19,7 @@ public class DudeneyNumber {
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 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
@ -32,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.
return cube_root == sum_of_digits;
}
}