Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Error de compilación
Main.java:3: error: class EstaOrdenado is public, should be declared in a file named EstaOrdenado.java public class EstaOrdenado { ^ 1 error |
||
#2 |
Error de compilación
Main.java:3: error: class EstaOrdenado is public, should be declared in a file named EstaOrdenado.java public class EstaOrdenado { ^ 1 error |
||
#3 |
Error de compilación
Main.java:3: error: class EstaOrdenado is public, should be declared in a file named EstaOrdenado.java public class EstaOrdenado { ^ 1 error |
||
#4 |
Error de compilación
Main.java:3: error: class EstaOrdenado is public, should be declared in a file named EstaOrdenado.java public class EstaOrdenado { ^ 1 error |
||
#5 |
Error de compilación
Main.java:3: error: class EstaOrdenado is public, should be declared in a file named EstaOrdenado.java public class EstaOrdenado { ^ 1 error |
||
#6 |
Error de compilación
Main.java:3: error: class EstaOrdenado is public, should be declared in a file named EstaOrdenado.java public class EstaOrdenado { ^ 1 error |
||
#7 |
Error de compilación
Main.java:3: error: class EstaOrdenado is public, should be declared in a file named EstaOrdenado.java public class EstaOrdenado { ^ 1 error |
||
#8 |
Error de compilación
Main.java:3: error: class EstaOrdenado is public, should be declared in a file named EstaOrdenado.java public class EstaOrdenado { ^ 1 error |
||
#9 |
Error de compilación
Main.java:3: error: class EstaOrdenado is public, should be declared in a file named EstaOrdenado.java public class EstaOrdenado { ^ 1 error |
||
#10 |
Error de compilación
Main.java:3: error: class EstaOrdenado is public, should be declared in a file named EstaOrdenado.java public class EstaOrdenado { ^ 1 error |
||
#11 |
Error de compilación
Main.java:3: error: class EstaOrdenado is public, should be declared in a file named EstaOrdenado.java public class EstaOrdenado { ^ 1 error |
||
#12 |
Error de compilación
Main.java:3: error: class EstaOrdenado is public, should be declared in a file named EstaOrdenado.java public class EstaOrdenado { ^ 1 error |
import java.util.Scanner; public class EstaOrdenado { public static void main(String args[]) { boolean ordenado = true; try { Scanner br = new Scanner(System.in); int N = br.nextInt(); int left = br.nextInt(); for (int i = 1; i < N && ordenado; i++) { int right = br.nextInt(); if (left > right) { ordenado = false; } left = right; } } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if (ordenado) { System.out.println("Ordenado"); } else { System.out.println("Desordenado"); } } }