Skip to content

Instantly share code, notes, and snippets.

@OlgaKulikova
Created October 29, 2014 20:47
Show Gist options
  • Save OlgaKulikova/a6003fee42bb51abcfbd to your computer and use it in GitHub Desktop.
Save OlgaKulikova/a6003fee42bb51abcfbd to your computer and use it in GitHub Desktop.
Минимум четырех чисел (JavaRush)
public class Solution {
public static int min(int a, int b, int c, int d)
{
int m2 = min(a, b);
if (m2 < c & m2 < d)
return m2;
if (c < m2 & c < d)
return c;
if (d < c & d < m2)
return d;
}
public static int min(int a, int b)
{
int m1;
if (a < b)
m1 = a;
else
m1 = b;
return m1;
}
}
@sbs-one
Copy link

sbs-one commented Jun 21, 2020

public static int min(int a, int b, int c, int d)
{
int m2 = min(a, b);
if (m2 < c & m2 < d)
return m2;
if (c < m2 & c < d)
return c;
if (d < c & d < m2)
return d;
return m2;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment