#1148
Se dă un şir cu n
elemente, numere naturale. Folosind metoda Divide et Impera să se verifice dacă în şir există elemente impare.
Problema | ExistaImpareDivImp | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #56060626 | Utilizator | |
Fișier | existaimparedivimp.cpp | Dimensiune | 596 B |
Data încărcării | 04 Februarie 2025, 15:12 | Scor / rezultat | Eroare de compilare |
existaimparedivimp.cpp: In function 'void VerParitateNr(int, int, int*)': existaimparedivimp.cpp:6:8: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses] if (st == dr) ^ existaimparedivimp.cpp:10:38: error: void value not ignored as it ought to be int nrSt = VerParitateNr(st, m, a) ^ existaimparedivimp.cpp:11:9: error: expected ',' or ';' before 'if' if (nrSt % 2 == 1) cout << "Nu"; ^ existaimparedivimp.cpp:12:7: error: 'else' without a previous 'if' else cout <<"DA"; ^ existaimparedivimp.cpp:13:43: error: void value not ignored as it ought to be int nrDr = VerParitateNr(m + 1, dr, a) ^ existaimparedivimp.cpp:14:9: error: expected ',' or ';' before 'if' if (nrDr % 2 == 1) cout << "Nu"; ^ existaimparedivimp.cpp:15:7: error: 'else' without a previous 'if' else cout <<"DA"; ^ existaimparedivimp.cpp:10:9: warning: unused variable 'nrSt' [-Wunused-variable] int nrSt = VerParitateNr(st, m, a) ^ existaimparedivimp.cpp:13:10: warning: unused variable 'nrDr' [-Wunused-variable] int nrDr = VerParitateNr(m + 1, dr, a) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema ExistaImpareDivImp 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ă.