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

Envío 5229

Problema 0x9d - ¿Está ordenado?

  • Autor: dvsalcedo
  • Fecha: 2021-10-28 20:47:57 UTC (Hace alrededor de 3 años)
Caso # Resultado Tiempo Memoria
#1
Error de compilación
                      Main.cs(8,11): error CS0019: Operator `<=' cannot be applied to operands of type `string' and `int'
Compilation failed: 1 error(s), 0 warnings

                    
#2
Error de compilación
                      Main.cs(8,11): error CS0019: Operator `<=' cannot be applied to operands of type `string' and `int'
Compilation failed: 1 error(s), 0 warnings

                    
#3
Error de compilación
                      Main.cs(8,11): error CS0019: Operator `<=' cannot be applied to operands of type `string' and `int'
Compilation failed: 1 error(s), 0 warnings

                    
#4
Error de compilación
                      Main.cs(8,11): error CS0019: Operator `<=' cannot be applied to operands of type `string' and `int'
Compilation failed: 1 error(s), 0 warnings

                    
#5
Error de compilación
                      Main.cs(8,11): error CS0019: Operator `<=' cannot be applied to operands of type `string' and `int'
Compilation failed: 1 error(s), 0 warnings

                    
#6
Error de compilación
                      Main.cs(8,11): error CS0019: Operator `<=' cannot be applied to operands of type `string' and `int'
Compilation failed: 1 error(s), 0 warnings

                    
#7
Error de compilación
                      Main.cs(8,11): error CS0019: Operator `<=' cannot be applied to operands of type `string' and `int'
Compilation failed: 1 error(s), 0 warnings

                    
#8
Error de compilación
                      Main.cs(8,11): error CS0019: Operator `<=' cannot be applied to operands of type `string' and `int'
Compilation failed: 1 error(s), 0 warnings

                    
#9
Error de compilación
                      Main.cs(8,11): error CS0019: Operator `<=' cannot be applied to operands of type `string' and `int'
Compilation failed: 1 error(s), 0 warnings

                    
#10
Error de compilación
                      Main.cs(8,11): error CS0019: Operator `<=' cannot be applied to operands of type `string' and `int'
Compilation failed: 1 error(s), 0 warnings

                    
#11
Error de compilación
                      Main.cs(8,11): error CS0019: Operator `<=' cannot be applied to operands of type `string' and `int'
Compilation failed: 1 error(s), 0 warnings

                    
#12
Error de compilación
                      Main.cs(8,11): error CS0019: Operator `<=' cannot be applied to operands of type `string' and `int'
Compilation failed: 1 error(s), 0 warnings

                    
Puntos totales: 0 / 100

Código

using System;

public class Program
{
   public static void Main()
   {
      var length = Console.ReadLine();
      if (length <= 1) {
          Console.WriteLine("Ordenado");
      }
      var input = Console.ReadLine();
      var numbers = input.Split(' ');

      for (int i=0; i<Int64.Parse(length) - 1; i++) {
        if (Int64.Parse(numbers[i]) >= Int64.Parse(numbers[i+1])) {
           Console.WriteLine("Desordenado");
           return;
        }
      }
      Console.WriteLine("Ordenado");
   }
}