#1
Să se scrie un program care citeşte din fişier două numere întregi şi determină suma lor.
| Problema | sum | Operații I/O |
sum.in/sum.out
|
|---|---|---|---|
| Limita timp | 1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64948259 | Utilizator | |
| Fișier | sum.c | Dimensiune | 193 B |
| Data încărcării | 21 Iunie 2026, 02:00 | Scor/rezultat | 0 puncte |
sum.c: In function ‘main’: sum.c:4:13: warning: passing argument 1 of ‘freopen’ from incompatible pointer type [-Wincompatible-pointer-types] 4 | freopen(stdin, "sum.in", "r"); | ^~~~~ | | | FILE * In file included from sum.c:1: /usr/include/stdio.h:271:46: note: expected ‘const char * restrict’ but argument is of type ‘FILE *’ 271 | extern FILE *freopen (const char *__restrict __filename, | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~ sum.c:4:30: warning: passing argument 3 of ‘freopen’ from incompatible pointer type [-Wincompatible-pointer-types] 4 | freopen(stdin, "sum.in", "r"); | ^~~ | | | char * /usr/include/stdio.h:273:40: note: expected ‘FILE * restrict’ but argument is of type ‘char *’ 273 | FILE *__restrict __stream) __wur __nonnull ((3)); | ~~~~~~~~~~~~~~~~~^~~~~~~~ sum.c:5:17: warning: passing argument 1 of ‘freopen’ from incompatible pointer type [-Wincompatible-pointer-types] 5 | freopen(stdout, "sum.out", "w"); | ^~~~~~ | | | FILE * /usr/include/stdio.h:271:46: note: expected ‘const char * restrict’ but argument is of type ‘FILE *’ 271 | extern FILE *freopen (const char *__restrict __filename, | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~ sum.c:5:36: warning: passing argument 3 of ‘freopen’ from incompatible pointer type [-Wincompatible-pointer-types] 5 | freopen(stdout, "sum.out", "w"); | ^~~ | | | char * /usr/include/stdio.h:273:40: note: expected ‘FILE * restrict’ but argument is of type ‘char *’ 273 | FILE *__restrict __stream) __wur __nonnull ((3)); | ~~~~~~~~~~~~~~~~~^~~~~~~~ sum.c:4:5: warning: ignoring return value of ‘freopen’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 4 | freopen(stdin, "sum.in", "r"); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sum.c:5:9: warning: ignoring return value of ‘freopen’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 5 | freopen(stdout, "sum.out", "w"); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sum.c:7:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | scanf("%d %d", &a, &b); | ^~~~~~~~~~~~~~~~~~~~~~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | Caught fatal signal 11 | 10 | 0 | ||
| 2 | 0.001 secunde | Caught fatal signal 11 | 10 | 0 | ||
| 3 | 0.001 secunde | Caught fatal signal 11 | 10 | 0 | ||
| 4 | 0.001 secunde | Caught fatal signal 11 | 10 | 0 | ||
| 5 | 0.001 secunde | Caught fatal signal 11 | 10 | 0 | ||
| 6 | 0.001 secunde | Caught fatal signal 11 | 10 | 0 | ||
| 7 | 0.002 secunde | Caught fatal signal 11 | 10 | 0 | ||
| 8 | 0.001 secunde | Caught fatal signal 11 | 10 | 0 | ||
| 9 | 0.001 secunde | Caught fatal signal 11 | 10 | 0 | Exemplu | |
| 10 | 0.001 secunde | Caught fatal signal 11 | 10 | 0 | ||
| Punctaj total | 0 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema sum 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ă.