#2
suma_n
Să se scrie un program care citeşte de la tastatură un şir de numere naturale şi determină suma lor.
Problema | suma_n | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #49440308 | Utilizator | |
Fișier | suma_n.cpp | Dimensiune | 3.78 KB |
Data încărcării | 01 Martie 2024, 17:35 | Scor / rezultat | 0 puncte |
suma_n.cpp: In function 'int main()': suma_n.cpp:16:16: warning: variable 'V' set but not used [-Wunused-but-set-variable] {int r,n,i,V[100],k,caz; ^ suma_n.cpp:90:10: warning: unused variable 'p' [-Wunused-variable] {int p=1,M[4][21]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,2,1,2,3,1,5,6,1,8,2,10,3,12,4,6,15,7,9,11,13,5,3,4,5,4,7,8,7,10,9,12,11,14,13,14,17,16,17,18,16,8,10,12,14,6,15,17,9,18,11,19,13,20,15,16,20,18,19,20,19},i,j; ^ suma_n.cpp:90:14: warning: unused variable 'M' [-Wunused-variable] {int p=1,M[4][21]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,2,1,2,3,1,5,6,1,8,2,10,3,12,4,6,15,7,9,11,13,5,3,4,5,4,7,8,7,10,9,12,11,14,13,14,17,16,17,18,16,8,10,12,14,6,15,17,9,18,11,19,13,20,15,16,20,18,19,20,19},i,j; ^ suma_n.cpp:90:229: warning: unused variable 'i' [-Wunused-variable] {int p=1,M[4][21]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,2,1,2,3,1,5,6,1,8,2,10,3,12,4,6,15,7,9,11,13,5,3,4,5,4,7,8,7,10,9,12,11,14,13,14,17,16,17,18,16,8,10,12,14,6,15,17,9,18,11,19,13,20,15,16,20,18,19,20,19},i,j; ^ suma_n.cpp:90:231: warning: unused variable 'j' [-Wunused-variable] {int p=1,M[4][21]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,2,1,2,3,1,5,6,1,8,2,10,3,12,4,6,15,7,9,11,13,5,3,4,5,4,7,8,7,10,9,12,11,14,13,14,17,16,17,18,16,8,10,12,14,6,15,17,9,18,11,19,13,20,15,16,20,18,19,20,19},i,j; ^
Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
---|---|---|---|---|---|---|
1 | 0 secunde | Raspuns gresit. | 10 | 0 | Exemplu | |
2 | 0 secunde | Raspuns gresit. | 90 | 0 | ||
Punctaj total | 0 |
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema suma_n 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ă.