#267
Se dau n numere naturale cu cel mult două cifre fiecare. Să se determine acele numere care apar o singură dată.
Variante Bacalaureat 2009
| Problema | Unice | Operații I/O |
unice.in/unice.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #60704438 | Utilizator | |
| Fișier | unice.c | Dimensiune | 405 B |
| Data încărcării | 09 Noiembrie 2025, 16:03 | Scor/rezultat | 0 puncte |
unice.c: In function 'main': unice.c:7:5: warning: passing argument 1 of 'fscanf' from incompatible pointer type [enabled by default] int n, nr; fscanf("%d", n); ^ In file included from /usr/include/features.h:374:0, from /usr/include/stdio.h:27, from unice.c:1: /usr/include/stdio.h:443:12: note: expected 'struct FILE * restrict' but argument is of type 'char *' extern int __REDIRECT (fscanf, (FILE *__restrict __stream, ^ unice.c:7:5: warning: passing argument 2 of 'fscanf' makes pointer from integer without a cast [enabled by default] int n, nr; fscanf("%d", n); ^ In file included from /usr/include/features.h:374:0, from /usr/include/stdio.h:27, from unice.c:1: /usr/include/stdio.h:443:12: note: expected 'const char * restrict' but argument is of type 'int' extern int __REDIRECT (fscanf, (FILE *__restrict __stream, ^ unice.c:7:5: warning: format not a string literal and no format arguments [-Wformat-security] int n, nr; fscanf("%d", n); ^ unice.c:11:6: warning: passing argument 1 of 'fscanf' from incompatible pointer type [enabled by default] fscanf("%d", nr); ^ In file included from /usr/include/features.h:374:0, from /usr/include/stdio.h:27, from unice.c:1: /usr/include/stdio.h:443:12: note: expected 'struct FILE * restrict' but argument is of type 'char *' extern int __REDIRECT (fscanf, (FILE *__restrict __stream, ^ unice.c:11:6: warning: passing argument 2 of 'fscanf' makes pointer from integer without a cast [enabled by default] fscanf("%d", nr); ^ In file included from /usr/include/features.h:374:0, from /usr/include/stdio.h:27, from unice.c:1: /usr/include/stdio.h:443:12: note: expected 'const char * restrict' but argument is of type 'int' extern int __REDIRECT (fscanf, (FILE *__restrict __stream, ^ unice.c:11:6: warning: format not a string literal and no format arguments [-Wformat-security] fscanf("%d", nr); ^ unice.c:19:9: warning: passing argument 1 of 'fprintf' from incompatible pointer type [enabled by default] if (v[i]==1) fprintf("%d ", v[i]); ^ In file included from /usr/include/stdio.h:937:0, from unice.c:1: /usr/include/i386-linux-gnu/bits/stdio2.h:95:1: note: expected 'struct FILE * restrict' but argument is of type 'char *' fprintf (FILE *__restrict __stream, const char *__restrict __fmt, ...) ^ unice.c:19:9: warning: passing argument 2 of 'fprintf' makes pointer from integer without a cast [enabled by default] if (v[i]==1) fprintf("%d ", v[i]); ^ In file included from /usr/include/stdio.h:937:0, from unice.c:1: /usr/include/i386-linux-gnu/bits/stdio2.h:95:1: note: expected 'const char * restrict' but argument is of type 'int' fprintf (FILE *__restrict __stream, const char *__restrict __fmt, ...) ^ unice.c:19:9: warning: format not a string literal and no format arguments [-Wformat-security] if (v[i]==1) fprintf("%d ", v[i]); ^ unice.c:7:22: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result [-Wunused-result] int n, nr; fscanf("%d", n); ^ unice.c:11:12: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result [-Wunused-result] fscanf("%d", nr); ^ unice.c:7:22: warning: 'n' is used uninitialized in this function [-Wuninitialized] int n, nr; fscanf("%d", n); ^ unice.c:11:12: warning: 'nr' may be used uninitialized in this function [-Wmaybe-uninitialized] fscanf("%d", nr); ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0 secunde | Caught fatal signal 11 | 20 | 0 | Exemplu | |
| 2 | 0 secunde | Caught fatal signal 11 | 40 | 0 | ||
| 3 | 0 secunde | Caught fatal signal 11 | 40 | 0 | ||
| Punctaj total | 0 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Unice face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
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ă.