#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 | #22943513 | Utilizator | |
Fișier | sumvec.cpp | Dimensiune | 529 B |
Data încărcării | 13 Mai 2020, 22:36 | Scor / rezultat | Eroare de compilare |
sumvec.cpp:3:1: error: stray '\302' in program int suma( int x[], int i, int j) ^ sumvec.cpp:3:1: error: stray '\240' in program sumvec.cpp:4:1: error: stray '\302' in program { ^ sumvec.cpp:4:1: error: stray '\240' in program sumvec.cpp:5:1: error: stray '\302' in program int v1, v2, s=0; ^ sumvec.cpp:5:1: error: stray '\240' in program sumvec.cpp:5:1: error: stray '\302' in program sumvec.cpp:5:1: error: stray '\240' in program sumvec.cpp:6:1: error: stray '\302' in program if(i==j) return x[i]; ^ sumvec.cpp:6:1: error: stray '\240' in program sumvec.cpp:6:1: error: stray '\302' in program sumvec.cpp:6:1: error: stray '\240' in program sumvec.cpp:6:1: error: stray '\302' in program sumvec.cpp:6:1: error: stray '\240' in program sumvec.cpp:7:1: error: stray '\302' in program else ^ sumvec.cpp:7:1: error: stray '\240' in program sumvec.cpp:7:1: error: stray '\302' in program sumvec.cpp:7:1: error: stray '\240' in program sumvec.cpp:8:1: error: stray '\302' in program { ^ sumvec.cpp:8:1: error: stray '\240' in program sumvec.cpp:8:1: error: stray '\302' in program sumvec.cpp:8:1: error: stray '\240' in program sumvec.cpp:9:1: error: stray '\302' in program v1=suma(x, i, (i+j)/2); ^ sumvec.cpp:9:1: error: stray '\240' in program sumvec.cpp:9:1: error: stray '\302' in program sumvec.cpp:9:1: error: stray '\240' in program sumvec.cpp:9:1: error: stray '\302' in program sumvec.cpp:9:1: error: stray '\240' in program sumvec.cpp:9:1: error: stray '\302' in program sumvec.cpp:9:1: error: stray '\240' in program sumvec.cpp:10:1: error: stray '\302' in program v2=suma(x, (i+j)/2+1,j); ^ sumvec.cpp:10:1: error: stray '\240' in program sumvec.cpp:10:1: error: stray '\302' in program sumvec.cpp:10:1: error: stray '\240' in program sumvec.cpp:10:1: error: stray '\302' in program sumvec.cpp:10:1: error: stray '\240' in program sumvec.cpp:10:1: error: stray '\302' in program sumvec.cpp:10:1: error: stray '\240' in program sumvec.cpp:10:1: error: stray '\302' in program sumvec.cpp:10:1: error: stray '\240' in program sumvec.cpp:11:1: error: stray '\302' in program if(v1%2==0 && v2%2==0) return s=v1+v2; ^ sumvec.cpp:11:1: error: stray '\240' in program sumvec.cpp:11:1: error: stray '\302' in program sumvec.cpp:11:1: error: stray '\240' in program sumvec.cpp:11:1: error: stray '\302' in program sumvec.cpp:11:1: error: stray '\240' in program sumvec.cpp:11:1: error: stray '\302' in program sumvec.cpp:11:1: error: stray '\240' in program sumvec.cpp:11:1: error: stray '\302' in program sumvec.cpp:11:1: error: stray '\240' in program sumvec.cpp:12:1: error: stray '\302' in program if(v2%2==0) return s=s+v2; ^ sumvec.cpp:12:1: error: stray '\240' in program sumvec.cpp:12:1: error: stray '\302' in program sumvec.cpp:12:1: error: stray '\240' in program sumvec.cpp:12:1: error: stray '\302' in program sumvec.cpp:12:1: error: stray '\240' in program sumvec.cpp:12:1: error: stray '\302' in program sumvec.cpp:12:1: error: stray '\240' in program sumvec.cpp:13:1: error: stray '\302' in program if(v1%2==0) return s=s+v1; ^ sumvec.cpp:13:1: error: stray '\240' in program sumvec.cpp:13:1: error: stray '\302' in program sumvec.cpp:13:1: error: stray '\240' in program sumvec.cpp:13:1: error: stray '\302' in program sumvec.cpp:13:1: error: stray '\240' in program sumvec.cpp:13:1: error: stray '\302' in program sumvec.cpp:13:1: error: stray '\240' in program sumvec.cpp:13:1: error: stray '\302' in program sumvec.cpp:13:1: error: stray '\240' in program sumvec.cpp:14:1: error: stray '\302' in program } ^ sumvec.cpp:14:1: error: stray '\240' in program sumvec.cpp:14:1: error: stray '\302' in program sumvec.cpp:14:1: error: stray '\240' in program sumvec.cpp:19:1: error: stray '\302' in program int a[1002], i, n; ^ sumvec.cpp:19:1: error: stray '\240' in program sumvec.cpp:19:1: error: stray '\302' in program sumvec.cpp:19:1: error: stray '\240' in program sumvec.cpp:20:1: error: stray '\302' in program cin>>n; ^ sumvec.cpp:20:1: error: stray '\240' in program sumvec.cpp:20:1: error: stray '\302' in program sumvec.cpp:20:1: error: stray '\240' in program sumvec.cpp:21:1: error: stray '\302' in program for(i=1;i<=n;i++) cin>>a[i]; ^ sumvec.cpp:21:1: error: stray '\240' in program sumvec.cpp:21:1: error: stray '\302' in program sumvec.cpp:21:1: error: stray '\240' in program sumvec.cpp:21:1: error: stray '\302' in program sumvec.cpp:21:1: error: stray '\240' in program sumvec.cpp:22:1: error: stray '\302' in program cout<<suma(a,1,n); ^ sumvec.cpp:22:1: error: stray '\240' in program sumvec.cpp:22:1: error: stray '\302' in program sumvec.cpp:22:1: error: stray '\240' in program sumvec.cpp:23:1: error: stray '\302' in program return 0; ^ sumvec.cpp:23:1: error: stray '\240' in program sumvec.cpp:23:1: error: stray '\302' in program sumvec.cpp:23:1: error: stray '\240' in program sumvec.cpp: In function 'int suma(int*, int, int)': sumvec.cpp:15:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
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ă.