package mayor;
import javax.swing.*;
public class mayor {
public static void main(String[] args) {
// TODO code application logic here
String k, j, l;
int a, b, c;
k = JOptionPane.showInputDialog("DA UN NUMERO: ");
j = JOptionPane.showInputDialog("DA UN NUMERO: ");
l = JOptionPane.showInputDialog("DA UN NUMERO: ");
a = Integer.parseInt(k);
b = Integer.parseInt(j);
c = Integer.parseInt(l);
if ((a < b) && (c < b))
{
JOptionPane.showMessageDialog(null,"EL MAYOR ES : "+b);
}
else if ((b < a) && (c < a))
{
JOptionPane.showMessageDialog(null,"EL MAYOR ES : "+a);
}
else if ((b < c) && (a < c))
{
JOptionPane.showMessageDialog(null,"EL MAYOR ES : "+c);
}
if ((a < b) && (a < c))
{
JOptionPane.showMessageDialog(null,"EL MENOR ES : "+a);
}
else if ((b < a) && (b < c))
{
JOptionPane.showMessageDialog(null,"EL MENOR ES : "+b);
}
else if ((c < b) && (c < a))
{
JOptionPane.showMessageDialog(null,"EL MENOR ES : "+c);
}
if ((a == b) && (a < c))
{
JOptionPane.showMessageDialog(null,"EL MENOR ES : "+a);
}
else if ((a == c) && (a < b))
{
JOptionPane.showMessageDialog(null,"EL MENOR ES : "+a);
}
else if ((b == c) && (b < a))
{
JOptionPane.showMessageDialog(null,"EL MENOR ES : "+b);
}
if ((a == b) && (a > c))
{
JOptionPane.showMessageDialog(null,"EL MAYOR ES : "+a);
}
else if ((a == c) && (a > b))
{
JOptionPane.showMessageDialog(null,"EL MAYOR ES : "+a);
}
else if ((b == c) && (b > a))
{
JOptionPane.showMessageDialog(null,"EL MAYOR ES : "+b);
}
if ((b == c) && (b == a))
{
JOptionPane.showMessageDialog(null," TODOS SON EL MISMO NUMERO: "+a);
}
}
}
ok revisado!
ResponderEliminar