Detalii evaluare #54139039

Rezumat problemă

#4286 Constr3

Se dă un vector x cu n elemente, numere naturale. Să se construiască un alt vector, y, care să conțină elementele impare din x, în ordine inversă.

Detalii

Problema Constr3 Operații I/O tastatură/ecran
Limita timp 0.1 secunde Limita memorie Total: 64 MB / Stivă 8 MB
Id soluție #54139039 Utilizator Nicolae Antonio (Antonio03)
Fișier constr3.c Dimensiune 228 B
Data încărcării 20 Noiembrie 2024, 17:03 Scor / rezultat Eroare de compilare

Evaluare


Mesaj compilare

constr3.c:1:1: error: expected identifier or '(' before numeric constant
 4286

 ^
In file included from /usr/include/stdio.h:74:0,
                 from constr3.c:2:
/usr/include/libio.h:306:3: error: unknown type name 'size_t'
   size_t __pad5;
   ^
/usr/include/libio.h:310:67: error: 'size_t' undeclared here (not in a function)
   char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
                                                                   ^
/usr/include/libio.h:338:62: error: expected declaration specifiers or '...' before 'size_t'
 typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes);
                                                              ^
/usr/include/libio.h:347:6: error: expected declaration specifiers or '...' before 'size_t'
      size_t __n);
      ^
/usr/include/libio.h:469:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before '_IO_sgetn'
 extern _IO_size_t _IO_sgetn (_IO_FILE *, void *, _IO_size_t);
                   ^
In file included from constr3.c:2:0:
/usr/include/stdio.h:337:20: error: expected declaration specifiers or '...' before 'size_t'
       int __modes, size_t __n) __THROW;
                    ^
/usr/include/stdio.h:386:44: error: expected declaration specifiers or '...' before 'size_t'
 extern int snprintf (char *__restrict __s, size_t __maxlen,
                                            ^
/usr/include/stdio.h:390:45: error: expected declaration specifiers or '...' before 'size_t'
 extern int vsnprintf (char *__restrict __s, size_t __maxlen,
                                             ^
/usr/include/stdio.h:709:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'fread'
 extern size_t fread (void *__restrict __ptr, size_t __size,
               ^
/usr/include/stdio.h:715:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'fwrite'
 extern size_t fwrite (const void *__restrict __ptr, size_t __size,
               ^
In file included from /usr/include/stdio.h:937:0,
                 from constr3.c:2:
/usr/include/i386-linux-gnu/bits/stdio2.h:23:61: error: expected declaration specifiers or '...' before 'size_t'
 extern int __sprintf_chk (char *__restrict __s, int __flag, size_t __slen,
                                                             ^
/usr/include/i386-linux-gnu/bits/stdio2.h:25:62: error: expected declaration specifiers or '...' before 'size_t'
 extern int __vsprintf_chk (char *__restrict __s, int __flag, size_t __slen,
                                                              ^
/usr/include/i386-linux-gnu/bits/stdio2.h:52:50: error: expected declaration specifiers or '...' before 'size_t'
 extern int __snprintf_chk (char *__restrict __s, size_t __n, int __flag,
                                                  ^
/usr/include/i386-linux-gnu/bits/stdio2.h:53:7: error: expected declaration specifiers or '...' before 'size_t'
       size_t __slen, const char *__restrict __format,
       ^
/usr/include/i386-linux-gnu/bits/stdio2.h:55:51: error: expected declaration specifiers or '...' before 'size_t'
 extern int __vsnprintf_chk (char *__restrict __s, size_t __n, int __flag,
                                                   ^
/usr/include/i386-linux-gnu/bits/stdio2.h:56:8: error: expected declaration specifiers or '...' before 'size_t'
        size_t __slen, const char *__restrict __format,
        ^
In file included from /usr/include/features.h:374:0,
                 from /usr/include/stdio.h:27,
                 from constr3.c:2:
/usr/include/i386-linux-gnu/bits/stdio2.h:61:1: error: expected declaration specifiers or '...' before 'size_t'
 __NTH (snprintf (char *__restrict __s, size_t __n,
 ^
/usr/include/i386-linux-gnu/bits/stdio2.h:74:1: error: expected declaration specifiers or '...' before 'size_t'
 __NTH (vsnprintf (char *__restrict __s, size_t __n,
 ^
In file included from /usr/include/stdio.h:937:0,
                 from constr3.c:2:
/usr/include/i386-linux-gnu/bits/stdio2.h:227:39: error: expected declaration specifiers or '...' before 'size_t'
 extern char *__gets_chk (char *__str, size_t) __wur;
                                       ^
/usr/include/i386-linux-gnu/bits/stdio2.h:241:49: error: expected declaration specifiers or '...' before 'size_t'
 extern char *__fgets_chk (char *__restrict __s, size_t __size, int __n,
                                                 ^
In file included from /usr/include/features.h:374:0,
                 from /usr/include/stdio.h:27,
                 from constr3.c:2:
/usr/include/i386-linux-gnu/bits/stdio2.h:246:14: error: expected declaration specifiers or '...' before 'size_t'
 extern char *__REDIRECT (__fgets_chk_warn,
              ^
In file included from /usr/include/stdio.h:937:0,
                 from constr3.c:2:
/usr/include/i386-linux-gnu/bits/stdio2.h: In function 'fgets':
/usr/include/i386-linux-gnu/bits/stdio2.h:260:20: error: expected ')' before '__n'
       if ((size_t) __n > __bos (__s))
                    ^
/usr/include/i386-linux-gnu/bits/stdio2.h: At top level:
/usr/include/i386-linux-gnu/bits/stdio2.h:266:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__fread_chk'
 extern size_t __fread_chk (void *__restrict __ptr, size_t __ptrlen,
               ^
In file included from /usr/include/features.h:374:0,
                 from /usr/include/stdio.h:27,
                 from constr3.c:2:
/usr/include/i386-linux-gnu/bits/stdio2.h:269:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__fread_alias'
 extern size_t __REDIRECT (__fread_alias,
               ^
/usr/include/i386-linux-gnu/bits/stdio2.h:273:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__fread_chk_warn'
 extern size_t __REDIRECT (__fread_chk_warn,
               ^
In file included from /usr/include/stdio.h:937:0,
                 from constr3.c:2:
/usr/include/i386-linux-gnu/bits/stdio2.h:282:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'fread'
 fread (void *__restrict __ptr, size_t __size, size_t __n,
 ^
constr3.c: In function 'main':
constr3.c:4:16: warning: unused variable 'b' [-Wunused-variable]
    int a[201], b[201], n, i;

                ^
constr3.c:5:9: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
    scanf("%d",&n);

         ^
constr3.c:7:15: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
          scanf("%d",&a[i]);

               ^

Cum funcționează evaluarea?

www.pbinfo.ro permite evaluarea a două tipuri de probleme:

  • probleme la care rezolvarea presupune scrierea unui program complet
  • probleme la care rezolvarea presupune scrierea unei secvențe de program - câteva instrucțiuni, o listă de declarații, una sau mai multe funcții, etc.

Problema Constr3 face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:

  • Programul sursă este compilat folosind compilatorul corespunzător. Dacă în urma compilării se obțin erori sau avertismente, acestea sunt afișate în această pagină.
  • Dacă programul a fost compilat, executabilul obținut va fi rulat, furnizându-i-se unul sau mai multe seturi de date de intrare, în concordanță cu restricțiile specifice problemei. Pentru fiecare set de date se obține un anumit punctaj, în raport cu corectitudinea soluției tale.

Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.