#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 | #60532045 | Utilizator | |
| Fișier | sum.cpp | Dimensiune | 1.92 KB |
| Data încărcării | 04 Noiembrie 2025, 14:10 | Scor/rezultat | 0 puncte |
sum.cpp: In function 'void devncon(p, p)': sum.cpp:41:24: warning: suggest parentheses around comparison in operand of '==' [-Wparentheses] if(sum(dd,l={x,x,x})==sum(k={dd.h,x,dd.c},l={x,b.l,x})==sum(k={dd.h,dd.l,x},l={x,x,b.c})==sum(k={dd.h,x,x},l={x,b.l,b.c})) ^ sum.cpp:41:58: warning: suggest parentheses around comparison in operand of '==' [-Wparentheses] if(sum(dd,l={x,x,x})==sum(k={dd.h,x,dd.c},l={x,b.l,x})==sum(k={dd.h,dd.l,x},l={x,x,b.c})==sum(k={dd.h,x,x},l={x,b.l,b.c})) ^ sum.cpp:41:125: warning: operation on 'l' may be undefined [-Wsequence-point] if(sum(dd,l={x,x,x})==sum(k={dd.h,x,dd.c},l={x,b.l,x})==sum(k={dd.h,dd.l,x},l={x,x,b.c})==sum(k={dd.h,x,x},l={x,b.l,b.c})) ^ sum.cpp:41:125: warning: operation on 'l' may be undefined [-Wsequence-point] sum.cpp:41:125: warning: operation on 'l' may be undefined [-Wsequence-point] sum.cpp:41:125: warning: operation on 'k' may be undefined [-Wsequence-point] sum.cpp:41:125: warning: operation on 'k' may be undefined [-Wsequence-point] sum.cpp:42:40: warning: suggest parentheses around comparison in operand of '==' [-Wparentheses] if(sum(k={x,dd.l,dd.c},l={b.h,x,x})==sum(k={x,dd.l,x},l={b.h,x,b.c})==sum(k={x,x,dd.c},l={b.h,b.l,x})==sum(k={x,x,x},l={b.h,b.l,b.c})) ^ sum.cpp:42:73: warning: suggest parentheses around comparison in operand of '==' [-Wparentheses] if(sum(k={x,dd.l,dd.c},l={b.h,x,x})==sum(k={x,dd.l,x},l={b.h,x,b.c})==sum(k={x,x,dd.c},l={b.h,b.l,x})==sum(k={x,x,x},l={b.h,b.l,b.c})) ^ sum.cpp:42:138: warning: operation on 'l' may be undefined [-Wsequence-point] if(sum(k={x,dd.l,dd.c},l={b.h,x,x})==sum(k={x,dd.l,x},l={b.h,x,b.c})==sum(k={x,x,dd.c},l={b.h,b.l,x})==sum(k={x,x,x},l={b.h,b.l,b.c})) ^ sum.cpp:42:138: warning: operation on 'l' may be undefined [-Wsequence-point] sum.cpp:42:138: warning: operation on 'l' may be undefined [-Wsequence-point] sum.cpp:42:138: warning: operation on 'k' may be undefined [-Wsequence-point] sum.cpp:42:138: warning: operation on 'k' may be undefined [-Wsequence-point] sum.cpp:42:138: warning: operation on 'k' may be undefined [-Wsequence-point]
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0 secunde | Raspuns gresit. | 10 | 0 | ||
| 2 | 0 secunde | Raspuns gresit. | 10 | 0 | ||
| 3 | 0 secunde | Raspuns gresit. | 10 | 0 | ||
| 4 | 0 secunde | Raspuns gresit. | 10 | 0 | ||
| 5 | 0 secunde | Raspuns gresit. | 10 | 0 | ||
| 6 | 0 secunde | Raspuns gresit. | 10 | 0 | ||
| 7 | 0 secunde | Raspuns gresit. | 10 | 0 | ||
| 8 | 0 secunde | Raspuns gresit. | 10 | 0 | ||
| 9 | 0 secunde | Raspuns gresit. | 10 | 0 | Exemplu | |
| 10 | 0 secunde | Raspuns gresit. | 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ă.