This commit is contained in:
Oleksii Aleshchenko 2023-03-16 15:58:44 +02:00
parent afc13cf9f8
commit 14c58d0cc4
1 changed files with 26 additions and 0 deletions

26
src/Lab2.java Normal file
View File

@ -0,0 +1,26 @@
public class Lab2 {
public static void main(String[] args) {
int[] array = {1, 2, 3};
/*for (int i = 0; i < array.length; i++) {
if (i % 2 == 0) {
System.out.println("!" + array[i]);
} else {
System.out.println("?" + array[i]);
}
}*/
for (int i = 0; i < array.length; i+=2) {
System.out.println("!" + array[i]);
}
for (int i = 1; i < array.length; i+=2) {
System.out.println("?" + array[i]);
}
// зубчасті матриці
int[][] matrix = {
{1, 2},
{3}
};
}
}