package com.javarush.task.task02.task0217;
/*
Минимум четырех чисел
*/
public class Solution {
public static int min(int a, int b, int c, int d) {
//напишите тут ваш код
int zz;
int zzz;
int zzzz;
if ( a<b){
zz = a;
}else {
zz= b;
}
if (zz<c){
zzz = zz;
}else {
zzz=c;
}
if (zzz<d){
zzzz=zzz;
}else {
zzzz=d;
}
int o;
if (o<zzzz){
o=o;
}
else{
o=zzzz;
}
return o;
}
public static int min(int a, int b) {
//напишите тут ваш код
int zz;
if (a<b){
zz=a;
} else{
zz=b;
}
return zz;
}
public static void main(String[] args) throws Exception {
System.out.println(min(-20, -10));
System.out.println(min(-40, -10, -30, 40));
System.out.println(min(-20, -40, -30, 40));
System.out.println(min(-20, -10, -40, 40));
System.out.println(min(-20, -10, -30, -40));
}
}
package com.javarush.task.task02.task0217;
/*
Минимум четырех чисел
*/
public class Solution {
public static int min(int a, int b, int c, int d) {
//напишите тут ваш код
int zz;
int zzz;
int zzzz;
if ( a<b){
zz = a;
}else {
zz= b;
}
if (zz<c){
zzz = zz;
}else {
zzz=c;
}
if (zzz<d){
zzzz=zzz;
}else {
zzzz=d;
}
int o;
if (o<zzzz){
o=o;
}
else{
o=zzzz;
}
return o;
}
public static int min(int a, int b) {
//напишите тут ваш код
int zz;
if (a<b){
zz=a;
} else{
zz=b;
}
return zz;
}
public static void main(String[] args) throws Exception {
System.out.println(min(-20, -10));
System.out.println(min(-40, -10, -30, 40));
System.out.println(min(-20, -40, -30, 40));
System.out.println(min(-20, -10, -40, 40));
System.out.println(min(-20, -10, -30, -40));
}
}
