tehadm
Администратор
- Сообщения
- 1 160
- Реакции
- 293
Задача: Задано 4 числа, необходимо найти минимальное
Java:
public class Main {
public static void main(String[] args) {
int[] numbers = {-9, 6, 0, -59};
}
}
Follow along with the video below to see how to install our site as a web app on your home screen.
Примечание: This feature currently requires accessing the site using the built-in Safari browser.
Задача: Задано 4 числа, необходимо найти минимальное
public class Main {
public static void main(String[] args) {
int[] numbers = {-9, 6, 0, -59};
}
}
import java.util.Arrays;
public class Main {
public static void main(String[] args) {
int[] numbers = {-9, 6, 0, -59};
Arrays.sort(numbers);
System.out.println(numbers[0]);
}
}
public class Main {
public static void main(String[] args) {
int[] numbers = {-9, 6, 0, -59};
int min = numbers[0];
for(int i = 0; i < numbers.length; i++){
if(min>numbers[i])
min = numbers[i];
}
System.out.println(min);
}
}