#4105
Se dă un vector cu n numere naturale. Să se determine câte dintre perechile de elemente din vector au același număr de divizori.
| Problema | NumarareDiv | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64072681 | Utilizator | |
| Fișier | numararediv.cpp | Dimensiune | 1007 B |
| Data încărcării | 15 Aprilie 2026, 16:21 | Scor/rezultat | Eroare de compilare |
numararediv.cpp: In function ‘int nrdiv(int)’: numararediv.cpp:16:1: error: a function-definition is not allowed here before ‘{’ token 16 | { | ^ numararediv.cpp:40:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 40 | int main() | ^~ numararediv.cpp:40:9: note: remove parentheses to default-initialize a variable 40 | int main() | ^~ | -- numararediv.cpp:40:9: note: or replace parentheses with braces to value-initialize a variable numararediv.cpp:41:1: error: a function-definition is not allowed here before ‘{’ token 41 | { | ^ numararediv.cpp:62:2: error: expected ‘}’ at end of input 62 | } | ^ numararediv.cpp:11:9: note: to match this ‘{’ 11 | { | ^ numararediv.cpp:62:2: error: expected ‘}’ at end of input 62 | } | ^ numararediv.cpp:8:5: note: to match this ‘{’ 8 | { | ^ numararediv.cpp:62:2: error: expected ‘}’ at end of input 62 | } | ^ numararediv.cpp:5:1: note: to match this ‘{’ 5 | { | ^ numararediv.cpp:6:13: warning: unused variable ‘nr’ [-Wunused-variable] 6 | int t=2,nr=2,p=0; | ^~ numararediv.cpp:62:2: warning: no return statement in function returning non-void [-Wreturn-type] 62 | } | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema NumarareDiv 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ă.