mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-23 12:35:55 +08:00
Refactor Code Style (#4151)
This commit is contained in:
@ -10,12 +10,12 @@ public class DeterminantOfMatrix {
|
||||
|
||||
// Determinant calculator
|
||||
//@return determinant of the input matrix
|
||||
static int determinant(int a[][], int n) {
|
||||
static int determinant(int[][] a, int n) {
|
||||
int det = 0, sign = 1, p = 0, q = 0;
|
||||
if (n == 1) {
|
||||
det = a[0][0];
|
||||
} else {
|
||||
int b[][] = new int[n - 1][n - 1];
|
||||
int[][] b = new int[n - 1][n - 1];
|
||||
for (int x = 0; x < n; x++) {
|
||||
p = 0;
|
||||
q = 0;
|
||||
@ -44,7 +44,7 @@ public class DeterminantOfMatrix {
|
||||
System.out.println("Enter matrix size (Square matrix only)");
|
||||
int n = in.nextInt();
|
||||
System.out.println("Enter matrix");
|
||||
int a[][] = new int[n][n];
|
||||
int[][] a = new int[n][n];
|
||||
for (int i = 0; i < n; i++) {
|
||||
for (int j = 0; j < n; j++) {
|
||||
a[i][j] = in.nextInt();
|
||||
|
@ -40,7 +40,7 @@ public class KrishnamurthyNumber {
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String args[]) throws IOException {
|
||||
public static void main(String[] args) throws IOException {
|
||||
BufferedReader br = new BufferedReader(
|
||||
new InputStreamReader(System.in)
|
||||
);
|
||||
|
@ -19,7 +19,7 @@ public class NonRepeatingElement {
|
||||
System.out.println("Array should contain even number of elements");
|
||||
return;
|
||||
}
|
||||
int arr[] = new int[n];
|
||||
int[] arr = new int[n];
|
||||
|
||||
System.out.println(
|
||||
"Enter " +
|
||||
|
@ -39,7 +39,7 @@ public class TrinomialTriangle {
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String argc[]) {
|
||||
public static void main(String[] argc) {
|
||||
int n = 6;
|
||||
printTrinomial(n);
|
||||
}
|
||||
|
Reference in New Issue
Block a user