add lab2
This commit is contained in:
		
							parent
							
								
									afc13cf9f8
								
							
						
					
					
						commit
						14c58d0cc4
					
				
							
								
								
									
										26
									
								
								src/Lab2.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								src/Lab2.java
									
									
									
									
									
										Normal 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}
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user