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

Envío 6228

Problema 0x9d - ¿Está ordenado?

  • Autor: carrillodev
  • Fecha: 2022-05-26 07:12:41 UTC (Hace más de 2 años)
Caso # Resultado Tiempo Memoria
#1
Error de compilación
                      main.cpp:12:10: error: use of undeclared identifier 'cin'; did you mean 'sin'?
  int n; cin>>n;
         ^~~
         sin
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/math.h:44:12: note: 'sin' declared here
using std::sin;
           ^
main.cpp:12:10: error: reference to overloaded function could not be resolved; did you mean to call it?
  int n; cin>>n;
         ^~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/cmath:437:5: note: possible target for call
    sin(_Tp __x)
    ^
main.cpp:15:5: error: use of undeclared identifier 'cin'; did you mean 'sin'?
    cin>>arr[n];
    ^~~
    sin
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/math.h:44:12: note: 'sin' declared here
using std::sin;
           ^
main.cpp:15:5: error: reference to overloaded function could not be resolved; did you mean to call it?
    cin>>arr[n];
    ^~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/cmath:437:5: note: possible target for call
    sin(_Tp __x)
    ^
main.cpp:17:24: error: use of undeclared identifier 'cout'
  if(isSorted(n, arr)) cout<<"Ordenado"<<endl;
                       ^
main.cpp:17:42: error: use of undeclared identifier 'endl'
  if(isSorted(n, arr)) cout<<"Ordenado"<<endl;
                                         ^
main.cpp:18:8: error: use of undeclared identifier 'cout'
  else cout<<"Desordenado"<<endl;
       ^
main.cpp:18:29: error: use of undeclared identifier 'endl'
  else cout<<"Desordenado"<<endl;
                            ^
8 errors generated.

                    
#2
Error de compilación
                      main.cpp:12:10: error: use of undeclared identifier 'cin'; did you mean 'sin'?
  int n; cin>>n;
         ^~~
         sin
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/math.h:44:12: note: 'sin' declared here
using std::sin;
           ^
main.cpp:12:10: error: reference to overloaded function could not be resolved; did you mean to call it?
  int n; cin>>n;
         ^~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/cmath:437:5: note: possible target for call
    sin(_Tp __x)
    ^
main.cpp:15:5: error: use of undeclared identifier 'cin'; did you mean 'sin'?
    cin>>arr[n];
    ^~~
    sin
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/math.h:44:12: note: 'sin' declared here
using std::sin;
           ^
main.cpp:15:5: error: reference to overloaded function could not be resolved; did you mean to call it?
    cin>>arr[n];
    ^~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/cmath:437:5: note: possible target for call
    sin(_Tp __x)
    ^
main.cpp:17:24: error: use of undeclared identifier 'cout'
  if(isSorted(n, arr)) cout<<"Ordenado"<<endl;
                       ^
main.cpp:17:42: error: use of undeclared identifier 'endl'
  if(isSorted(n, arr)) cout<<"Ordenado"<<endl;
                                         ^
main.cpp:18:8: error: use of undeclared identifier 'cout'
  else cout<<"Desordenado"<<endl;
       ^
main.cpp:18:29: error: use of undeclared identifier 'endl'
  else cout<<"Desordenado"<<endl;
                            ^
8 errors generated.

                    
#3
Error de compilación
                      main.cpp:12:10: error: use of undeclared identifier 'cin'; did you mean 'sin'?
  int n; cin>>n;
         ^~~
         sin
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/math.h:44:12: note: 'sin' declared here
using std::sin;
           ^
main.cpp:12:10: error: reference to overloaded function could not be resolved; did you mean to call it?
  int n; cin>>n;
         ^~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/cmath:437:5: note: possible target for call
    sin(_Tp __x)
    ^
main.cpp:15:5: error: use of undeclared identifier 'cin'; did you mean 'sin'?
    cin>>arr[n];
    ^~~
    sin
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/math.h:44:12: note: 'sin' declared here
using std::sin;
           ^
main.cpp:15:5: error: reference to overloaded function could not be resolved; did you mean to call it?
    cin>>arr[n];
    ^~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/cmath:437:5: note: possible target for call
    sin(_Tp __x)
    ^
main.cpp:17:24: error: use of undeclared identifier 'cout'
  if(isSorted(n, arr)) cout<<"Ordenado"<<endl;
                       ^
main.cpp:17:42: error: use of undeclared identifier 'endl'
  if(isSorted(n, arr)) cout<<"Ordenado"<<endl;
                                         ^
main.cpp:18:8: error: use of undeclared identifier 'cout'
  else cout<<"Desordenado"<<endl;
       ^
main.cpp:18:29: error: use of undeclared identifier 'endl'
  else cout<<"Desordenado"<<endl;
                            ^
8 errors generated.

                    
#4
Error de compilación
                      main.cpp:12:10: error: use of undeclared identifier 'cin'; did you mean 'sin'?
  int n; cin>>n;
         ^~~
         sin
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/math.h:44:12: note: 'sin' declared here
using std::sin;
           ^
main.cpp:12:10: error: reference to overloaded function could not be resolved; did you mean to call it?
  int n; cin>>n;
         ^~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/cmath:437:5: note: possible target for call
    sin(_Tp __x)
    ^
main.cpp:15:5: error: use of undeclared identifier 'cin'; did you mean 'sin'?
    cin>>arr[n];
    ^~~
    sin
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/math.h:44:12: note: 'sin' declared here
using std::sin;
           ^
main.cpp:15:5: error: reference to overloaded function could not be resolved; did you mean to call it?
    cin>>arr[n];
    ^~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/cmath:437:5: note: possible target for call
    sin(_Tp __x)
    ^
main.cpp:17:24: error: use of undeclared identifier 'cout'
  if(isSorted(n, arr)) cout<<"Ordenado"<<endl;
                       ^
main.cpp:17:42: error: use of undeclared identifier 'endl'
  if(isSorted(n, arr)) cout<<"Ordenado"<<endl;
                                         ^
main.cpp:18:8: error: use of undeclared identifier 'cout'
  else cout<<"Desordenado"<<endl;
       ^
main.cpp:18:29: error: use of undeclared identifier 'endl'
  else cout<<"Desordenado"<<endl;
                            ^
8 errors generated.

                    
#5
Error de compilación
                      main.cpp:12:10: error: use of undeclared identifier 'cin'; did you mean 'sin'?
  int n; cin>>n;
         ^~~
         sin
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/math.h:44:12: note: 'sin' declared here
using std::sin;
           ^
main.cpp:12:10: error: reference to overloaded function could not be resolved; did you mean to call it?
  int n; cin>>n;
         ^~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/cmath:437:5: note: possible target for call
    sin(_Tp __x)
    ^
main.cpp:15:5: error: use of undeclared identifier 'cin'; did you mean 'sin'?
    cin>>arr[n];
    ^~~
    sin
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/math.h:44:12: note: 'sin' declared here
using std::sin;
           ^
main.cpp:15:5: error: reference to overloaded function could not be resolved; did you mean to call it?
    cin>>arr[n];
    ^~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/cmath:437:5: note: possible target for call
    sin(_Tp __x)
    ^
main.cpp:17:24: error: use of undeclared identifier 'cout'
  if(isSorted(n, arr)) cout<<"Ordenado"<<endl;
                       ^
main.cpp:17:42: error: use of undeclared identifier 'endl'
  if(isSorted(n, arr)) cout<<"Ordenado"<<endl;
                                         ^
main.cpp:18:8: error: use of undeclared identifier 'cout'
  else cout<<"Desordenado"<<endl;
       ^
main.cpp:18:29: error: use of undeclared identifier 'endl'
  else cout<<"Desordenado"<<endl;
                            ^
8 errors generated.

                    
#6
Error de compilación
                      main.cpp:12:10: error: use of undeclared identifier 'cin'; did you mean 'sin'?
  int n; cin>>n;
         ^~~
         sin
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/math.h:44:12: note: 'sin' declared here
using std::sin;
           ^
main.cpp:12:10: error: reference to overloaded function could not be resolved; did you mean to call it?
  int n; cin>>n;
         ^~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/cmath:437:5: note: possible target for call
    sin(_Tp __x)
    ^
main.cpp:15:5: error: use of undeclared identifier 'cin'; did you mean 'sin'?
    cin>>arr[n];
    ^~~
    sin
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/math.h:44:12: note: 'sin' declared here
using std::sin;
           ^
main.cpp:15:5: error: reference to overloaded function could not be resolved; did you mean to call it?
    cin>>arr[n];
    ^~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/cmath:437:5: note: possible target for call
    sin(_Tp __x)
    ^
main.cpp:17:24: error: use of undeclared identifier 'cout'
  if(isSorted(n, arr)) cout<<"Ordenado"<<endl;
                       ^
main.cpp:17:42: error: use of undeclared identifier 'endl'
  if(isSorted(n, arr)) cout<<"Ordenado"<<endl;
                                         ^
main.cpp:18:8: error: use of undeclared identifier 'cout'
  else cout<<"Desordenado"<<endl;
       ^
main.cpp:18:29: error: use of undeclared identifier 'endl'
  else cout<<"Desordenado"<<endl;
                            ^
8 errors generated.

                    
#7
Error de compilación
                      main.cpp:12:10: error: use of undeclared identifier 'cin'; did you mean 'sin'?
  int n; cin>>n;
         ^~~
         sin
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/math.h:44:12: note: 'sin' declared here
using std::sin;
           ^
main.cpp:12:10: error: reference to overloaded function could not be resolved; did you mean to call it?
  int n; cin>>n;
         ^~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/cmath:437:5: note: possible target for call
    sin(_Tp __x)
    ^
main.cpp:15:5: error: use of undeclared identifier 'cin'; did you mean 'sin'?
    cin>>arr[n];
    ^~~
    sin
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/math.h:44:12: note: 'sin' declared here
using std::sin;
           ^
main.cpp:15:5: error: reference to overloaded function could not be resolved; did you mean to call it?
    cin>>arr[n];
    ^~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/cmath:437:5: note: possible target for call
    sin(_Tp __x)
    ^
main.cpp:17:24: error: use of undeclared identifier 'cout'
  if(isSorted(n, arr)) cout<<"Ordenado"<<endl;
                       ^
main.cpp:17:42: error: use of undeclared identifier 'endl'
  if(isSorted(n, arr)) cout<<"Ordenado"<<endl;
                                         ^
main.cpp:18:8: error: use of undeclared identifier 'cout'
  else cout<<"Desordenado"<<endl;
       ^
main.cpp:18:29: error: use of undeclared identifier 'endl'
  else cout<<"Desordenado"<<endl;
                            ^
8 errors generated.

                    
#8
Error de compilación
                      main.cpp:12:10: error: use of undeclared identifier 'cin'; did you mean 'sin'?
  int n; cin>>n;
         ^~~
         sin
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/math.h:44:12: note: 'sin' declared here
using std::sin;
           ^
main.cpp:12:10: error: reference to overloaded function could not be resolved; did you mean to call it?
  int n; cin>>n;
         ^~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/cmath:437:5: note: possible target for call
    sin(_Tp __x)
    ^
main.cpp:15:5: error: use of undeclared identifier 'cin'; did you mean 'sin'?
    cin>>arr[n];
    ^~~
    sin
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/math.h:44:12: note: 'sin' declared here
using std::sin;
           ^
main.cpp:15:5: error: reference to overloaded function could not be resolved; did you mean to call it?
    cin>>arr[n];
    ^~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/cmath:437:5: note: possible target for call
    sin(_Tp __x)
    ^
main.cpp:17:24: error: use of undeclared identifier 'cout'
  if(isSorted(n, arr)) cout<<"Ordenado"<<endl;
                       ^
main.cpp:17:42: error: use of undeclared identifier 'endl'
  if(isSorted(n, arr)) cout<<"Ordenado"<<endl;
                                         ^
main.cpp:18:8: error: use of undeclared identifier 'cout'
  else cout<<"Desordenado"<<endl;
       ^
main.cpp:18:29: error: use of undeclared identifier 'endl'
  else cout<<"Desordenado"<<endl;
                            ^
8 errors generated.

                    
#9
Error de compilación
                      main.cpp:12:10: error: use of undeclared identifier 'cin'; did you mean 'sin'?
  int n; cin>>n;
         ^~~
         sin
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/math.h:44:12: note: 'sin' declared here
using std::sin;
           ^
main.cpp:12:10: error: reference to overloaded function could not be resolved; did you mean to call it?
  int n; cin>>n;
         ^~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/cmath:437:5: note: possible target for call
    sin(_Tp __x)
    ^
main.cpp:15:5: error: use of undeclared identifier 'cin'; did you mean 'sin'?
    cin>>arr[n];
    ^~~
    sin
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/math.h:44:12: note: 'sin' declared here
using std::sin;
           ^
main.cpp:15:5: error: reference to overloaded function could not be resolved; did you mean to call it?
    cin>>arr[n];
    ^~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/cmath:437:5: note: possible target for call
    sin(_Tp __x)
    ^
main.cpp:17:24: error: use of undeclared identifier 'cout'
  if(isSorted(n, arr)) cout<<"Ordenado"<<endl;
                       ^
main.cpp:17:42: error: use of undeclared identifier 'endl'
  if(isSorted(n, arr)) cout<<"Ordenado"<<endl;
                                         ^
main.cpp:18:8: error: use of undeclared identifier 'cout'
  else cout<<"Desordenado"<<endl;
       ^
main.cpp:18:29: error: use of undeclared identifier 'endl'
  else cout<<"Desordenado"<<endl;
                            ^
8 errors generated.

                    
#10
Error de compilación
                      main.cpp:12:10: error: use of undeclared identifier 'cin'; did you mean 'sin'?
  int n; cin>>n;
         ^~~
         sin
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/math.h:44:12: note: 'sin' declared here
using std::sin;
           ^
main.cpp:12:10: error: reference to overloaded function could not be resolved; did you mean to call it?
  int n; cin>>n;
         ^~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/cmath:437:5: note: possible target for call
    sin(_Tp __x)
    ^
main.cpp:15:5: error: use of undeclared identifier 'cin'; did you mean 'sin'?
    cin>>arr[n];
    ^~~
    sin
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/math.h:44:12: note: 'sin' declared here
using std::sin;
           ^
main.cpp:15:5: error: reference to overloaded function could not be resolved; did you mean to call it?
    cin>>arr[n];
    ^~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/cmath:437:5: note: possible target for call
    sin(_Tp __x)
    ^
main.cpp:17:24: error: use of undeclared identifier 'cout'
  if(isSorted(n, arr)) cout<<"Ordenado"<<endl;
                       ^
main.cpp:17:42: error: use of undeclared identifier 'endl'
  if(isSorted(n, arr)) cout<<"Ordenado"<<endl;
                                         ^
main.cpp:18:8: error: use of undeclared identifier 'cout'
  else cout<<"Desordenado"<<endl;
       ^
main.cpp:18:29: error: use of undeclared identifier 'endl'
  else cout<<"Desordenado"<<endl;
                            ^
8 errors generated.

                    
#11
Error de compilación
                      main.cpp:12:10: error: use of undeclared identifier 'cin'; did you mean 'sin'?
  int n; cin>>n;
         ^~~
         sin
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/math.h:44:12: note: 'sin' declared here
using std::sin;
           ^
main.cpp:12:10: error: reference to overloaded function could not be resolved; did you mean to call it?
  int n; cin>>n;
         ^~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/cmath:437:5: note: possible target for call
    sin(_Tp __x)
    ^
main.cpp:15:5: error: use of undeclared identifier 'cin'; did you mean 'sin'?
    cin>>arr[n];
    ^~~
    sin
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/math.h:44:12: note: 'sin' declared here
using std::sin;
           ^
main.cpp:15:5: error: reference to overloaded function could not be resolved; did you mean to call it?
    cin>>arr[n];
    ^~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/cmath:437:5: note: possible target for call
    sin(_Tp __x)
    ^
main.cpp:17:24: error: use of undeclared identifier 'cout'
  if(isSorted(n, arr)) cout<<"Ordenado"<<endl;
                       ^
main.cpp:17:42: error: use of undeclared identifier 'endl'
  if(isSorted(n, arr)) cout<<"Ordenado"<<endl;
                                         ^
main.cpp:18:8: error: use of undeclared identifier 'cout'
  else cout<<"Desordenado"<<endl;
       ^
main.cpp:18:29: error: use of undeclared identifier 'endl'
  else cout<<"Desordenado"<<endl;
                            ^
8 errors generated.

                    
#12
Error de compilación
                      main.cpp:12:10: error: use of undeclared identifier 'cin'; did you mean 'sin'?
  int n; cin>>n;
         ^~~
         sin
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/math.h:44:12: note: 'sin' declared here
using std::sin;
           ^
main.cpp:12:10: error: reference to overloaded function could not be resolved; did you mean to call it?
  int n; cin>>n;
         ^~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/cmath:437:5: note: possible target for call
    sin(_Tp __x)
    ^
main.cpp:15:5: error: use of undeclared identifier 'cin'; did you mean 'sin'?
    cin>>arr[n];
    ^~~
    sin
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/math.h:44:12: note: 'sin' declared here
using std::sin;
           ^
main.cpp:15:5: error: reference to overloaded function could not be resolved; did you mean to call it?
    cin>>arr[n];
    ^~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/cmath:437:5: note: possible target for call
    sin(_Tp __x)
    ^
main.cpp:17:24: error: use of undeclared identifier 'cout'
  if(isSorted(n, arr)) cout<<"Ordenado"<<endl;
                       ^
main.cpp:17:42: error: use of undeclared identifier 'endl'
  if(isSorted(n, arr)) cout<<"Ordenado"<<endl;
                                         ^
main.cpp:18:8: error: use of undeclared identifier 'cout'
  else cout<<"Desordenado"<<endl;
       ^
main.cpp:18:29: error: use of undeclared identifier 'endl'
  else cout<<"Desordenado"<<endl;
                            ^
8 errors generated.

                    
Puntos totales: 0 / 100

Código

#include <math.h>
using namespace std;

bool isSorted(int n, int arr[]) {
  for(int i = 1; i < n; i++) {
    if(arr[i-1] > arr[i]) return false;
  }
  return true;
}

int main() {
  int n; cin>>n;
  int arr[n];
  for(int i = 0; i < n; ++i) {
    cin>>arr[n];
  }
  if(isSorted(n, arr)) cout<<"Ordenado"<<endl;
  else cout<<"Desordenado"<<endl;
  return 0;
}