#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 | #20639867 | Utilizator | |
Fișier | sumvec.cpp | Dimensiune | 3.06 KB |
Data încărcării | 05 Februarie 2020, 19:42 | Scor / rezultat | Eroare de compilare |
sumvec.cpp:31:2: error: stray '#' in program }#include <iostream> ^ sumvec.cpp:61:2: error: stray '#' in program }#include <iostream> ^ sumvec.cpp:91:2: error: stray '#' in program }#include <iostream> ^ sumvec.cpp:121:2: error: stray '#' in program }#include <iostream> ^ sumvec.cpp:151:2: error: stray '#' in program }#include <iostream> ^ sumvec.cpp:181:2: error: stray '#' in program }#include <iostream> ^ sumvec.cpp:31:3: error: 'include' does not name a type }#include <iostream> ^ sumvec.cpp: In function 'int suma(int, int)': sumvec.cpp:35:5: error: redefinition of 'int suma(int, int)' int suma(int x,int y) ^ sumvec.cpp:5:5: error: 'int suma(int, int)' previously defined here int suma(int x,int y) ^ sumvec.cpp: In function 'int divide(int*, int, int)': sumvec.cpp:40:5: error: redefinition of 'int divide(int*, int, int)' int divide(int v[],int st, int dr) ^ sumvec.cpp:10:5: error: 'int divide(int*, int, int)' previously defined here int divide(int v[],int st, int dr) ^ sumvec.cpp: In function 'int main()': sumvec.cpp:54:5: error: redefinition of 'int main()' int main() ^ sumvec.cpp:24:5: error: 'int main()' previously defined here int main() ^ sumvec.cpp: At global scope: sumvec.cpp:61:3: error: 'include' does not name a type }#include <iostream> ^ sumvec.cpp: In function 'int suma(int, int)': sumvec.cpp:65:5: error: redefinition of 'int suma(int, int)' int suma(int x,int y) ^ sumvec.cpp:5:5: error: 'int suma(int, int)' previously defined here int suma(int x,int y) ^ sumvec.cpp: In function 'int divide(int*, int, int)': sumvec.cpp:70:5: error: redefinition of 'int divide(int*, int, int)' int divide(int v[],int st, int dr) ^ sumvec.cpp:10:5: error: 'int divide(int*, int, int)' previously defined here int divide(int v[],int st, int dr) ^ sumvec.cpp: In function 'int main()': sumvec.cpp:84:5: error: redefinition of 'int main()' int main() ^ sumvec.cpp:24:5: error: 'int main()' previously defined here int main() ^ sumvec.cpp: At global scope: sumvec.cpp:91:3: error: 'include' does not name a type }#include <iostream> ^ sumvec.cpp: In function 'int suma(int, int)': sumvec.cpp:95:5: error: redefinition of 'int suma(int, int)' int suma(int x,int y) ^ sumvec.cpp:5:5: error: 'int suma(int, int)' previously defined here int suma(int x,int y) ^ sumvec.cpp: In function 'int divide(int*, int, int)': sumvec.cpp:100:5: error: redefinition of 'int divide(int*, int, int)' int divide(int v[],int st, int dr) ^ sumvec.cpp:10:5: error: 'int divide(int*, int, int)' previously defined here int divide(int v[],int st, int dr) ^ sumvec.cpp: In function 'int main()': sumvec.cpp:114:5: error: redefinition of 'int main()' int main() ^ sumvec.cpp:24:5: error: 'int main()' previously defined here int main() ^ sumvec.cpp: At global scope: sumvec.cpp:121:3: error: 'include' does not name a type }#include <iostream> ^ sumvec.cpp: In function 'int suma(int, int)': sumvec.cpp:125:5: error: redefinition of 'int suma(int, int)' int suma(int x,int y) ^ sumvec.cpp:5:5: error: 'int suma(int, int)' previously defined here int suma(int x,int y) ^ sumvec.cpp: In function 'int divide(int*, int, int)': sumvec.cpp:130:5: error: redefinition of 'int divide(int*, int, int)' int divide(int v[],int st, int dr) ^ sumvec.cpp:10:5: error: 'int divide(int*, int, int)' previously defined here int divide(int v[],int st, int dr) ^ sumvec.cpp: In function 'int main()': sumvec.cpp:144:5: error: redefinition of 'int main()' int main() ^ sumvec.cpp:24:5: error: 'int main()' previously defined here int main() ^ sumvec.cpp: At global scope: sumvec.cpp:151:3: error: 'include' does not name a type }#include <iostream> ^ sumvec.cpp: In function 'int suma(int, int)': sumvec.cpp:155:5: error: redefinition of 'int suma(int, int)' int suma(int x,int y) ^ sumvec.cpp:5:5: error: 'int suma(int, int)' previously defined here int suma(int x,int y) ^ sumvec.cpp: In function 'int divide(int*, int, int)': sumvec.cpp:160:5: error: redefinition of 'int divide(int*, int, int)' int divide(int v[],int st, int dr) ^ sumvec.cpp:10:5: error: 'int divide(int*, int, int)' previously defined here int divide(int v[],int st, int dr) ^ sumvec.cpp: In function 'int main()': sumvec.cpp:174:5: error: redefinition of 'int main()' int main() ^ sumvec.cpp:24:5: error: 'int main()' previously defined here int main() ^ sumvec.cpp: At global scope: sumvec.cpp:181:3: error: 'include' does not name a type }#include <iostream> ^ sumvec.cpp: In function 'int suma(int, int)': sumvec.cpp:185:5: error: redefinition of 'int suma(int, int)' int suma(int x,int y) ^ sumvec.cpp:5:5: error: 'int suma(int, int)' previously defined here int suma(int x,int y) ^ sumvec.cpp: In function 'int divide(int*, int, int)': sumvec.cpp:190:5: error: redefinition of 'int divide(int*, int, int)' int divide(int v[],int st, int dr) ^ sumvec.cpp:10:5: error: 'int divide(int*, int, int)' previously defined here int divide(int v[],int st, int dr) ^ sumvec.cpp: In function 'int main()': sumvec.cpp:204:5: error: redefinition of 'int main()' int main() ^ sumvec.cpp:24:5: error: 'int main()' previously defined here int main() ^
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ă.