Guest User

Untitled

a guest
Apr 21st, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. package org.ip.sesion05;
  2.  
  3. import java.io.*;
  4.  
  5. import org.ip.eInteractiva.*;
  6.  
  7. public class Mayor {
  8.  
  9. public static void main(String[] args) throws IOException {
  10. int a,b,c,m;
  11. System.out.print("Introduzca el primer número deseado: ");
  12. a = EntradaInteractiva.leerEntero();
  13. System.out.print("Introduzca el segundo número deseado: ");
  14. b = EntradaInteractiva.leerEntero();
  15. System.out.print("Introduzca el tercer número deseado: ");
  16. c = EntradaInteractiva.leerEntero();
  17. m=mayor(a,b,c);
  18. System.out.println("Resultado: "+m);
  19.  
  20. }
  21.  
  22. public static int mayor(int x, int y, int z){
  23. if(x>y && y>z) return x;
  24. else if(y>x && y>z) return y;
  25. return z;
  26. }
  27.  
  28.  
  29. }
Add Comment
Please, Sign In to add comment