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

Envío 3503

Problema 0x9d - ¿Está ordenado?

  • Autor: TacoMeister
  • Fecha: 2021-03-16 16:05:36 UTC (Hace alrededor de 3 años)
Caso # Resultado Tiempo Memoria
#1
Error de compilación
                      main.c:4:17: error: size of array has non-integer type 'double'
  double n,arr [n];
                ^
1 error generated.

                    
#2
Error de compilación
                      main.c:4:17: error: size of array has non-integer type 'double'
  double n,arr [n];
                ^
1 error generated.

                    
#3
Error de compilación
                      main.c:4:17: error: size of array has non-integer type 'double'
  double n,arr [n];
                ^
1 error generated.

                    
#4
Error de compilación
                      main.c:4:17: error: size of array has non-integer type 'double'
  double n,arr [n];
                ^
1 error generated.

                    
#5
Error de compilación
                      main.c:4:17: error: size of array has non-integer type 'double'
  double n,arr [n];
                ^
1 error generated.

                    
#6
Error de compilación
                      main.c:4:17: error: size of array has non-integer type 'double'
  double n,arr [n];
                ^
1 error generated.

                    
#7
Error de compilación
                      main.c:4:17: error: size of array has non-integer type 'double'
  double n,arr [n];
                ^
1 error generated.

                    
#8
Error de compilación
                      main.c:4:17: error: size of array has non-integer type 'double'
  double n,arr [n];
                ^
1 error generated.

                    
#9
Error de compilación
                      main.c:4:17: error: size of array has non-integer type 'double'
  double n,arr [n];
                ^
1 error generated.

                    
#10
Error de compilación
                      main.c:4:17: error: size of array has non-integer type 'double'
  double n,arr [n];
                ^
1 error generated.

                    
#11
Error de compilación
                      main.c:4:17: error: size of array has non-integer type 'double'
  double n,arr [n];
                ^
1 error generated.

                    
#12
Error de compilación
                      main.c:4:17: error: size of array has non-integer type 'double'
  double n,arr [n];
                ^
1 error generated.

                    
Puntos totales: 0 / 100

Código

#include <stdio.h>

int main () {
  double n,arr [n];
  int i, check;
  while ((i <= sizeof (arr) / sizeof (double)) && (check == 0)) {
    if ((arr [i]) > (arr [i] + 1)) {
      check = 1;
    }
    i ++;
  }
  if (check == 1) {
    printf ("Desordenado");
  }
  else {
    printf ("Ordenado");
  }   
}