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

Envío 5225

Problema 0x9d - ¿Está ordenado?

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

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

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

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

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

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

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

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

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

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

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

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

                    
Puntos totales: 0 / 100

Código

using System;

public class Program
{
   public static void Main()
   {
      var length = Console.ReadLine();
      var input = Console.ReadLine();
      var numbers = input.Split(' ');

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