#1015
SumVec
Se consideră un șir cu n
elemente, numere naturale. Folosind metoda Divide et Impera, determinați suma elementelor acestui șir.
Problema | SumVec | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #28702443 | Utilizator | |
Fișier | sumvec.cpp | Dimensiune | 365 B |
Data încărcării | 15 Martie 2021, 17:18 | Scor / rezultat | Eroare de compilare |
sumvec.cpp:4:30: error: conflicting declaration 'int& s' void divide(int s,int d,int &s) ^ sumvec.cpp:4:17: error: 's' has a previous declaration as 'int s' void divide(int s,int d,int &s) ^ sumvec.cpp: In function 'void divide(int, int)': sumvec.cpp:10:22: error: too many arguments to function 'void divide(int, int)' divide(s,m,s1); ^ sumvec.cpp:4:6: note: declared here void divide(int s,int d,int &s) ^ sumvec.cpp:11:24: error: too many arguments to function 'void divide(int, int)' divide(m+1,d,s2); ^ sumvec.cpp:4:6: note: declared here void divide(int s,int d,int &s) ^ sumvec.cpp: In function 'int main()': sumvec.cpp:19:14: warning: right operand of comma operator has no effect [-Wunused-value] for(i=1,i<=n;i++) ^ sumvec.cpp:19:21: error: expected ';' before ')' token for(i=1,i<=n;i++) ^ sumvec.cpp:21:17: error: too many arguments to function 'void divide(int, int)' divide(1,n,s); ^ sumvec.cpp:4:6: note: declared here void divide(int s,int d,int &s) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema SumVec 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ă.