Skip to content

Commit

Permalink
java 1 example of hw #2
Browse files Browse the repository at this point in the history
  • Loading branch information
biblelamp committed May 14, 2018
1 parent 5284fe4 commit a343fce
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Java 1/HW2Lesson.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Java. Level 1. Lesson 2. Example of homework
*
* @author Sergey Iryupin
* @version dated Feb 02, 2018
* @version dated May 14, 2018
*/
import java.util.Arrays;
import java.util.Scanner;
Expand Down Expand Up @@ -55,6 +55,7 @@ static void invertArray() {
// invert
for (int i = 0; i < array.length; i++)
array[i] = 1 - array[i];
//array[i] = array[i] ^ 1;
//array[i] = (array[i] == 1)? 0 : 1;
System.out.println(Arrays.toString(array));
}
Expand Down Expand Up @@ -92,6 +93,7 @@ static void fillDiagonal(int size) {
matrix[i][i] = 1;
matrix[i][size - i - 1] = 1;
}
System.out.println(Arrays.deepToString(matrix));
for (int i = 0; i < size; i++)
System.out.println(Arrays.toString(matrix[i]));
}
Expand Down

0 comments on commit a343fce

Please sign in to comment.