#1149
Se dă un şir cu n elemente, numere naturale. Folosind metoda Divide et Impera să se verifice dacă în șir există elemente prime.
| Problema | ExistaPrimeDivImp | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64725106 | Utilizator | |
| Fișier | existaprimedivimp.cpp | Dimensiune | 641 B |
| Data încărcării | 26 Mai 2026, 10:31 | Scor/rezultat | Eroare de compilare |
existaprimedivimp.cpp: In function ‘int main()’: existaprimedivimp.cpp:31:14: error: too few arguments to function ‘int Divide(int*, int, int)’ 31 | if(Divide(v, n)!=0) | ~~~~~~^~~~~~ existaprimedivimp.cpp:3:5: note: declared here 3 | int Divide(int v[], int st, int dr) | ^~~~~~ existaprimedivimp.cpp:33:5: warning: this ‘else’ clause does not guard... [-Wmisleading-indentation] 33 | else | ^~~~ existaprimedivimp.cpp:34:20: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘else’ 34 | cout<<"NU"; | ^ existaprimedivimp.cpp:34:20: error: expected ‘}’ at end of input existaprimedivimp.cpp:26:1: note: to match this ‘{’ 26 | { | ^ existaprimedivimp.cpp: In function ‘int Divide(int*, int, int)’: existaprimedivimp.cpp:24:1: warning: control reaches end of non-void function [-Wreturn-type] 24 | } | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema ExistaPrimeDivImp 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ă.