mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-26 05:59:22 +08:00
Format code with prettier (#3375)
This commit is contained in:
@ -8,6 +8,7 @@ Krishnamurthy number is also referred to as a Strong number.
|
||||
import java.io.*;
|
||||
|
||||
public class KrishnamurthyNumber {
|
||||
|
||||
//returns True if the number is a Krishnamurthy number and False if it is not.
|
||||
|
||||
public static boolean isKMurthy(int n) {
|
||||
@ -44,8 +45,12 @@ public class KrishnamurthyNumber {
|
||||
}
|
||||
|
||||
public static void main(String args[]) throws IOException {
|
||||
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
|
||||
System.out.println("Enter a number to check if it is a Krishnamurthy number: ");
|
||||
BufferedReader br = new BufferedReader(
|
||||
new InputStreamReader(System.in)
|
||||
);
|
||||
System.out.println(
|
||||
"Enter a number to check if it is a Krishnamurthy number: "
|
||||
);
|
||||
int n = Integer.parseInt(br.readLine());
|
||||
if (isKMurthy(n)) {
|
||||
System.out.println(n + " is a Krishnamurthy number.");
|
||||
|
Reference in New Issue
Block a user