█████████ ████ ███░░░░░███ ░░███ ███ ░░░ ██████ ███████ ██████ ██████ ░███ ███░░███ ███░░███ ███░░███ ███░░███ ░███ ░███ ░███░███ ░███ ░███████ ░███ ░███ ░░███ ███░███ ░███░███ ░███ ░███░░░ ░███ ░███ ░░█████████ ░░██████ ░░████████░░██████ ░░██████ ░░░░░░░░░ ░░░░░░ ░░░░░░░░ ░░░░░░ ░░░░░░

Envío 7304

Problema 0x9d - ¿Está ordenado?

  • Autor: manuel claros
  • Fecha: 2024-05-14 17:54:03 UTC (Hace 4 meses)
Caso # Resultado Tiempo Memoria
#1
Error de compilación
                      Main.java:29: error: reached end of file while parsing
}
 ^
1 error

                    
#2
Error de compilación
                      Main.java:29: error: reached end of file while parsing
}
 ^
1 error

                    
#3
Error de compilación
                      Main.java:29: error: reached end of file while parsing
}
 ^
1 error

                    
#4
Error de compilación
                      Main.java:29: error: reached end of file while parsing
}
 ^
1 error

                    
#5
Error de compilación
                      Main.java:29: error: reached end of file while parsing
}
 ^
1 error

                    
#6
Error de compilación
                      Main.java:29: error: reached end of file while parsing
}
 ^
1 error

                    
#7
Error de compilación
                      Main.java:29: error: reached end of file while parsing
}
 ^
1 error

                    
#8
Error de compilación
                      Main.java:29: error: reached end of file while parsing
}
 ^
1 error

                    
#9
Error de compilación
                      Main.java:29: error: reached end of file while parsing
}
 ^
1 error

                    
#10
Error de compilación
                      Main.java:29: error: reached end of file while parsing
}
 ^
1 error

                    
#11
Error de compilación
                      Main.java:29: error: reached end of file while parsing
}
 ^
1 error

                    
#12
Error de compilación
                      Main.java:29: error: reached end of file while parsing
}
 ^
1 error

                    
Puntos totales: 0 / 100

Código

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        // Leer el número de elementos en el arreglo
        int N = scanner.nextInt();

        // Leer los elementos del arreglo
        int[] arreglo = new int[N];
        for (int i = 0; i < N; i++) {
            arreglo[i] = scanner.nextInt();
        }

        // Verificar si el arreglo está ordenado
        
    

  
    
        for (int i = 0; i < arreglo.length - 1; i++) {
            if (arreglo[i] > arreglo[i + 1]) {
                System.out.print("Desordenado");
            }else
        {System.out.print("Ordenado");
}
    }
}