Решил попробовать, но 4-е условие не хочет принимать, хотя все работает . Подскажите, можно ли решить данную задачу через массив?
package com.javarush.task.task05.task0531;
import java.io.BufferedReader;
import java.io.InputStreamReader;
/*
Совершенствуем функциональность
*/
public class Solution {
public static int z;
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int a = 0;
int b = 0;
int c = 0;
int d = 0;
int e = 0;
int[] x = new int[5];
x[0] = Integer.parseInt(reader.readLine());
a = x[0];
x[1] = Integer.parseInt(reader.readLine());
b = x[1];
x[2] = Integer.parseInt(reader.readLine());
c = x[2];
x[3] = Integer.parseInt(reader.readLine());
d = x[3];
x[4] = Integer.parseInt(reader.readLine());
e = x[4];
int z = x[0];
for(int i = 0; i<x.length; i++){
if(z > x[i]){
z=x[i];
}
}
int minimum = z;
System.out.println("Minimum = " + minimum);
}
public static int min(int a, int b, int c, int d, int e) {
return z;
}
}