#187
CifFrecv
Să se scrie un program care citeşte cel mult 1.000.000
de numere naturale din intervalul închis [0,9]
şi determină cel mai mare număr prim citit şi numărul său de apariţii.
Variante Bacalaureat 2009
Problema | CifFrecv | Operații I/O |
ciffrecv.in /ciffrecv.out
|
---|---|---|---|
Limita timp | 1 secunde | Limita memorie |
Total: 4 MB
/
Stivă 4 MB
|
Id soluție | #44317318 | Utilizator | |
Fișier | ciffrecv.c | Dimensiune | 852 B |
Data încărcării | 31 Iulie 2023, 20:59 | Scor / rezultat | Eroare de compilare |
ciffrecv.c: In function 'main': ciffrecv.c:8:2: warning: passing argument 1 of 'fopen' from incompatible pointer type [enabled by default] f=fopen(&f, "ciffrecv.in", "r"); ^ In file included from ciffrecv.c:1:0: /usr/include/stdio.h:272:14: note: expected 'const char * restrict' but argument is of type 'struct FILE **' extern FILE *fopen (const char *__restrict __filename, ^ ciffrecv.c:8:2: error: too many arguments to function 'fopen' f=fopen(&f, "ciffrecv.in", "r"); ^ In file included from ciffrecv.c:1:0: /usr/include/stdio.h:272:14: note: declared here extern FILE *fopen (const char *__restrict __filename, ^ ciffrecv.c:9:2: warning: passing argument 1 of 'fopen' from incompatible pointer type [enabled by default] g=fopen(&g, "ciffrecv.out", "w"); ^ In file included from ciffrecv.c:1:0: /usr/include/stdio.h:272:14: note: expected 'const char * restrict' but argument is of type 'struct FILE **' extern FILE *fopen (const char *__restrict __filename, ^ ciffrecv.c:9:2: error: too many arguments to function 'fopen' g=fopen(&g, "ciffrecv.out", "w"); ^ In file included from ciffrecv.c:1:0: /usr/include/stdio.h:272:14: note: declared here extern FILE *fopen (const char *__restrict __filename, ^ ciffrecv.c:23:3: warning: implicit declaration of function 'printf_s' [-Wimplicit-function-declaration] printf_s("%d ", vf[i]); ^ ciffrecv.c:18:9: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result [-Wunused-result] fscanf(f, "%d", &temp); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema CifFrecv 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ă.