Conversation
| } No newline at end of file | ||
| public static void main(String[] args) { | ||
|
|
||
| makeGood maker = new makeGood(); |
There was a problem hiding this comment.
Strongly recommend having class names that start with an uppercase letter, not lowercase.
| try(Scanner scanner = new Scanner(file)) { | ||
| int n = scanner.nextInt(); | ||
| int m = scanner.nextInt(); | ||
| // n - число неизвестных (без ответа), m - число уравнений |
There was a problem hiding this comment.
Maybe you can write comments in English? Think about someone reading your code and improve the functionality. He won't understand anything in your comments. And also, consider using better names for the variables (this way you won't even use a comment to describe the code, the self-describing code is always better than a comment).
|
|
||
| matrix.steppedViewDown(); | ||
| } catch (FileNotFoundException e) { | ||
| System.out.println("I hope that never happen"); |
There was a problem hiding this comment.
Maybe there needs to be something more describing the exception. In case it happens you will know what causes the exception to happen and then fix the bug or add some readable output on what causes the exception to happen.
| import java.io.FileNotFoundException; | ||
| import java.io.FileWriter; | ||
| import java.io.IOException; | ||
| class Matrix { |
There was a problem hiding this comment.
Let the code be more readable and add here an empty line to distinguish imports and the class definition.
| this.M = m; | ||
| } | ||
| // true - ненулевое | ||
| boolean checkValue(int i, int j) { |
There was a problem hiding this comment.
Remove the comment and rename the method something like "isNotZero".
| try (FileWriter writer = new FileWriter(file)) { | ||
| writer.write(s); | ||
| } catch (IOException e) { | ||
| System.out.printf("Exception"); |
There was a problem hiding this comment.
If the program prints "Exception" it gives you nothing to fix it. It doesn't print where the exception happened. So, if you have a lot of these you wouldn't even know where the exception happened.
| return (this.checkNonzero(i + 1, j) || this.checkValue(i, j)); | ||
| } | ||
| else { | ||
| return this.checkValue(i, j); |
There was a problem hiding this comment.
I see that you using "this" everywhere. It is not necessary to write in places where it is not ambiguous. When you have the local variable that has the same name as your class member variable then you need to use "this" and nowhere else.
| this.rows[i] = this.rows[j]; | ||
| this.rows[j] = row; | ||
| } | ||
| String getString() { |
There was a problem hiding this comment.
Use empty lines to separate different methods.
| */ | ||
| class Row { // N на 1 больше, чем вход, т.к. тут я учитываю и ответ (то, что справа от равно) | ||
| int N; | ||
| ComplexNumber[] line = new ComplexNumber[1]; |
There was a problem hiding this comment.
You don't need to write an initial value for the array if you will rewrite it anyway. Like in the constructor.
| @@ -0,0 +1,45 @@ | |||
| class makeGood { | |||
There was a problem hiding this comment.
As I wrote above, the name of the class should start with an uppercase letter.
Hi!
Check this out plz, btw probably I found a mistake in test output
I checked answer which I get by that program and find out that it is correct