#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 | #48781536 | Utilizator | |
Fișier | existaimparedivimp.cpp | Dimensiune | 476 B |
Data încărcării | 05 Februarie 2024, 14:45 | Scor / rezultat | Eroare de compilare |
existaimparedivimp.cpp:20:11: warning: missing terminating ' character [enabled by default] cin>>n' ^ existaimparedivimp.cpp:20:5: error: missing terminating ' character cin>>n' ^ existaimparedivimp.cpp: In function 'int nr_imp(int, int)': existaimparedivimp.cpp:14:35: error: invalid conversion from 'int*' to 'int' [-fpermissive] return nr_imp(v, st, (st+dr)/2)+ nr_imp(v, (st+dr)/2, dr) ^ existaimparedivimp.cpp:14:35: error: too many arguments to function 'int nr_imp(int, int)' existaimparedivimp.cpp:6:5: note: declared here int nr_imp (int st, int dr) ^ existaimparedivimp.cpp:14:61: error: invalid conversion from 'int*' to 'int' [-fpermissive] return nr_imp(v, st, (st+dr)/2)+ nr_imp(v, (st+dr)/2, dr) ^ existaimparedivimp.cpp:14:61: error: too many arguments to function 'int nr_imp(int, int)' existaimparedivimp.cpp:6:5: note: declared here int nr_imp (int st, int dr) ^ existaimparedivimp.cpp:15:1: error: expected ';' before '}' token } ^ existaimparedivimp.cpp: In function 'int main()': existaimparedivimp.cpp:21:5: error: expected ';' before 'int' int v[n+1] ^ existaimparedivimp.cpp:22:15: warning: statement has no effect [-Wunused-value] for(i=0; i<=n; i++) ^ existaimparedivimp.cpp:22:23: error: expected ';' before ')' token for(i=0; i<=n; i++) ^ existaimparedivimp.cpp:24:23: error: invalid conversion from 'int*' to 'int' [-fpermissive] k=nr_imp(v, 0, n-1); ^ existaimparedivimp.cpp:24:23: error: too many arguments to function 'int nr_imp(int, int)' existaimparedivimp.cpp:6:5: note: declared here int nr_imp (int st, int dr) ^ existaimparedivimp.cpp:28:9: error: expected ';' before 'return' return 0; ^
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ă.