package com.javarush.task.task12.task1233; //If I go and prepare a place for you, I will come again, and will receive you to myself; //that where I am, you may be there also. (John 14:3) /* Изоморфы наступают */ public class Solution { public static void main(String[] args) throws Exception { int[] data = new int[]{1, 2, 3, 5, -2, -8, 0, 77, 5, 5}; Pair result = getMinimumAndIndex(data); System.out.println("Minimum is " + result.x); System.out.println("Index of minimum element is " + result.y); } public static Pair getMinimumAndIndex(int[] array) { if (array == null || array.length == 0) { return new Pair(null, null); } int min = array[0];//напишите тут ваш код int index = 0; for (int i = 0; i < array.length; i++) { if (array[i](min, index); } public static class Pair { public X x; public Y y; public Pair(X x, Y y) { this.x = x; this.y = y; } } } /* Изоморфы наступают Написать метод, который возвращает минимальное число в массиве и его позицию (индекс). Требования: 1. Класс Solution должен содержать класс Pair. 2. Класс Solution должен содержать два метода. 3. Класс Solution должен содержать метод getMinimumAndIndex(). 4. Метод getMinimumAndIndex() должен возвращать минимальное число в массиве и его позицию (индекс). package com.javarush.task.task12.task1233; Изоморфы наступают public class Solution { public static void main(String[] args) throws Exception { int[] data = new int[]{1, 2, 3, 5, -2, -8, 0, 77, 5, 5}; Pair result = getMinimumAndIndex(data); System.out.println("Minimum is " + result.x); System.out.println("Index of minimum element is " + result.y); } public static Pair getMinimumAndIndex(int[] array) { if (array == null || array.length == 0) { return new Pair(null, null); } //напишите тут ваш код return new Pair(0, 0); } public static class Pair { public X x; public Y y; public Pair(X x, Y y) { this.x = x; this.y = y; } } } */