Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Error de compilación
Main.java:25: error: ';' expected System.out.println("Number out of range") ^ 1 error |
||
#2 |
Error de compilación
Main.java:25: error: ';' expected System.out.println("Number out of range") ^ 1 error |
||
#3 |
Error de compilación
Main.java:25: error: ';' expected System.out.println("Number out of range") ^ 1 error |
||
#4 |
Error de compilación
Main.java:25: error: ';' expected System.out.println("Number out of range") ^ 1 error |
||
#5 |
Error de compilación
Main.java:25: error: ';' expected System.out.println("Number out of range") ^ 1 error |
||
#6 |
Error de compilación
Main.java:25: error: ';' expected System.out.println("Number out of range") ^ 1 error |
||
#7 |
Error de compilación
Main.java:25: error: ';' expected System.out.println("Number out of range") ^ 1 error |
||
#8 |
Error de compilación
Main.java:25: error: ';' expected System.out.println("Number out of range") ^ 1 error |
||
#9 |
Error de compilación
Main.java:25: error: ';' expected System.out.println("Number out of range") ^ 1 error |
||
#10 |
Error de compilación
Main.java:25: error: ';' expected System.out.println("Number out of range") ^ 1 error |
||
#11 |
Error de compilación
Main.java:25: error: ';' expected System.out.println("Number out of range") ^ 1 error |
||
#12 |
Error de compilación
Main.java:25: error: ';' expected System.out.println("Number out of range") ^ 1 error |
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); if (n > 0 && n < 1000) { int [] a = new int[n]; for (int i = 0; i < n; i++) { a[i] = sc.nextInt(); } boolean sorted = true; for (int i = 0; i + 1 < n; i++) { sorted = sorted && (a[i] <= a[i + 1]); } if (sorted == true) { System.out.println("Ordenado"); } else { System.out.println("Desordenado"); } } else { System.out.println("Number out of range") } } }