#1148
ExistaImpareDivImp
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 | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #34314720 | Utilizator | |
Fișier | existaimparedivimp.cpp | Dimensiune | 468 B |
Data încărcării | 28 Ianuarie 2022, 18:12 | Scor / rezultat | Eroare de compilare |
existaimparedivimp.cpp: In function 'void exista_impar(int*, int, int)': existaimparedivimp.cpp:5:18: error: 'st' was not declared in this scope return v[st] % 2 == 1; ^ existaimparedivimp.cpp:5:29: error: return-statement with a value, in function returning 'void' [-fpermissive] return v[st] % 2 == 1; ^ existaimparedivimp.cpp:8:38: error: could not convert 'exista_impar(v, i, mij)' from 'void' to 'bool' return exista_impar(v, i, mij) || exista_impar(v, mij + 1, j); ^ existaimparedivimp.cpp:8:69: error: could not convert 'exista_impar(v, (mij + 1), j)' from 'void' to 'bool' return exista_impar(v, i, mij) || exista_impar(v, mij + 1, j); ^ existaimparedivimp.cpp:8:69: error: return-statement with a value, in function returning 'void' [-fpermissive] existaimparedivimp.cpp: In function 'int main()': existaimparedivimp.cpp:17:28: error: could not convert 'exista_impar(((int*)(& v)), 1, n)' from 'void' to 'bool' if(exista_impar(v, 1, n)) ^
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ă.