#1827
VectorSumPrim
C++
Scrieți definiția completă a subprogramului P
care primeşte prin intermediul parametrului n
un număr natural nenul (n≤100
), iar prin intermediul parametrului x
un tablou unidimensional cu n
componente întregi, de maximum șase cifre fiecare.
Subprogramul furnizează prin intermediul parametrului s
suma elementelor din tabloul x
care au valori numere prime.
Problema | VectorSumPrim | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #51396949 | Utilizator | |
Fișier | vectorsumprim.cpp | Dimensiune | 297 B |
Data încărcării | 12 Iunie 2024, 16:32 | Scor / rezultat | Eroare de compilare |
vectorsumprim.cpp:6:1: error: stray '\302' in program int d; ^ vectorsumprim.cpp:6:1: error: stray '\240' in program vectorsumprim.cpp:6:1: error: stray '\302' in program vectorsumprim.cpp:6:1: error: stray '\240' in program vectorsumprim.cpp:7:1: error: stray '\302' in program if(n<2) return 0; ^ vectorsumprim.cpp:7:1: error: stray '\240' in program vectorsumprim.cpp:7:1: error: stray '\302' in program vectorsumprim.cpp:7:1: error: stray '\240' in program vectorsumprim.cpp:8:1: error: stray '\302' in program for(d=2; d*d<=n; d++) ^ vectorsumprim.cpp:8:1: error: stray '\240' in program vectorsumprim.cpp:8:1: error: stray '\302' in program vectorsumprim.cpp:8:1: error: stray '\240' in program vectorsumprim.cpp:9:1: error: stray '\302' in program if(n%d==0) ^ vectorsumprim.cpp:9:1: error: stray '\240' in program vectorsumprim.cpp:9:1: error: stray '\302' in program vectorsumprim.cpp:9:1: error: stray '\240' in program vectorsumprim.cpp:9:1: error: stray '\302' in program vectorsumprim.cpp:9:1: error: stray '\240' in program vectorsumprim.cpp:9:1: error: stray '\302' in program vectorsumprim.cpp:9:1: error: stray '\240' in program vectorsumprim.cpp:10:1: error: stray '\302' in program return 0; ^ vectorsumprim.cpp:10:1: error: stray '\240' in program vectorsumprim.cpp:10:1: error: stray '\302' in program vectorsumprim.cpp:10:1: error: stray '\240' in program vectorsumprim.cpp:10:1: error: stray '\302' in program vectorsumprim.cpp:10:1: error: stray '\240' in program vectorsumprim.cpp:10:1: error: stray '\302' in program vectorsumprim.cpp:10:1: error: stray '\240' in program vectorsumprim.cpp:11:1: error: stray '\302' in program return 1; ^ vectorsumprim.cpp:11:1: error: stray '\240' in program vectorsumprim.cpp:11:1: error: stray '\302' in program vectorsumprim.cpp:11:1: error: stray '\240' in program vectorsumprim.cpp:14:1: error: stray '\302' in program { ^ vectorsumprim.cpp:14:1: error: stray '\240' in program vectorsumprim.cpp:15:1: error: stray '\302' in program s=0; ^ vectorsumprim.cpp:15:1: error: stray '\240' in program vectorsumprim.cpp:15:1: error: stray '\302' in program vectorsumprim.cpp:15:1: error: stray '\240' in program vectorsumprim.cpp:15:1: error: stray '\302' in program vectorsumprim.cpp:15:1: error: stray '\240' in program vectorsumprim.cpp:16:1: error: stray '\302' in program for(int i=1; i<=n; i++) ^ vectorsumprim.cpp:16:1: error: stray '\240' in program vectorsumprim.cpp:16:1: error: stray '\302' in program vectorsumprim.cpp:16:1: error: stray '\240' in program vectorsumprim.cpp:16:1: error: stray '\302' in program vectorsumprim.cpp:16:1: error: stray '\240' in program vectorsumprim.cpp:17:1: error: stray '\302' in program if(prim(v[i])) ^ vectorsumprim.cpp:17:1: error: stray '\240' in program vectorsumprim.cpp:17:1: error: stray '\302' in program vectorsumprim.cpp:17:1: error: stray '\240' in program vectorsumprim.cpp:17:1: error: stray '\302' in program vectorsumprim.cpp:17:1: error: stray '\240' in program vectorsumprim.cpp:17:1: error: stray '\302' in program vectorsumprim.cpp:17:1: error: stray '\240' in program vectorsumprim.cpp:18:1: error: stray '\302' in program s+=v[i]; ^ vectorsumprim.cpp:18:1: error: stray '\240' in program vectorsumprim.cpp:18:1: error: stray '\302' in program vectorsumprim.cpp:18:1: error: stray '\240' in program vectorsumprim.cpp:18:1: error: stray '\302' in program vectorsumprim.cpp:18:1: error: stray '\240' in program vectorsumprim.cpp:18:1: error: stray '\302' in program vectorsumprim.cpp:18:1: error: stray '\240' in program
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema VectorSumPrim face parte din a doua categorie. Pentru aceste probleme se folosește un program suport, furnizat de propunătorul problemei. 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ă.