mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-12-19 07:00:35 +08:00
Format code with prettier (#3375)
This commit is contained in:
@@ -18,10 +18,17 @@ public class PowerSum {
|
||||
PowerSum ps = new PowerSum();
|
||||
int count = ps.powSum(N, X);
|
||||
//printing the answer.
|
||||
System.out.println("Number of combinations of different natural number's raised to " + X + " having sum " + N + " are : ");
|
||||
System.out.println(
|
||||
"Number of combinations of different natural number's raised to " +
|
||||
X +
|
||||
" having sum " +
|
||||
N +
|
||||
" are : "
|
||||
);
|
||||
System.out.println(count);
|
||||
sc.close();
|
||||
}
|
||||
|
||||
private int count = 0, sum = 0;
|
||||
|
||||
public int powSum(int N, int X) {
|
||||
@@ -48,7 +55,7 @@ public class PowerSum {
|
||||
}
|
||||
}
|
||||
|
||||
//creating a separate power function so that it can be used again and again when required.
|
||||
//creating a separate power function so that it can be used again and again when required.
|
||||
private int power(int a, int b) {
|
||||
return (int) Math.pow(a, b);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user