Advertisement
Guest User

TP0

a guest
Aug 16th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class eje4 {
  3. public static void main(String[] args){
  4. Scanner S = new Scanner(System.in);
  5. int a,b,c;
  6. String r;
  7.  
  8. do{
  9. System.out.println("Ingrese el primer numero:");
  10. a = S.nextInt();
  11. System.out.println("Ingrese el segundo numero:");
  12. b = S.nextInt();
  13. System.out.println("Ingrese el tercer numero");
  14. c = S.nextInt();
  15. if (a<b && b<c){
  16. System.out.println("los numeros estan ordenados en orden ascendente");
  17. }
  18. else{
  19. if (a>b && b>c){
  20. System.out.println("los numeros estan ordenados en orden descendente");
  21. }
  22. else{
  23. if (a==b && b==c){
  24. System.out.println("los numeros son iguales");
  25. }
  26. else{
  27. System.out.println("los numeros estan desordenados");
  28. }
  29. }
  30. }
  31. System.out.println("DESEA SALIR(s/n)");
  32. r = S.next();
  33. }while(!r.equals("n"));
  34.  
  35.  
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement