#4110
Se dă un vector cu n numere naturale. Să se determine câte dintre perechile de elemente din vector au aceeași sumă a divizorilor.
| Problema | NumarareSD | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64637309 | Utilizator | |
| Fișier | numararesd.cpp | Dimensiune | 555 B |
| Data încărcării | 19 Mai 2026, 18:51 | Scor/rezultat | Eroare de compilare |
numararesd.cpp: In function ‘int main()’: numararesd.cpp:7:5: error: two or more data types in declaration of ‘n’ 7 | int int n,v[1001],i,j,c,x,y,sx,sy; | ^~~ numararesd.cpp:7:5: error: two or more data types in declaration of ‘v’ numararesd.cpp:7:5: error: two or more data types in declaration of ‘i’ numararesd.cpp:7:5: error: two or more data types in declaration of ‘j’ numararesd.cpp:7:5: error: two or more data types in declaration of ‘c’ numararesd.cpp:7:5: error: two or more data types in declaration of ‘x’ numararesd.cpp:7:5: error: two or more data types in declaration of ‘y’ numararesd.cpp:7:5: error: two or more data types in declaration of ‘sx’ numararesd.cpp:7:5: error: two or more data types in declaration of ‘sy’ numararesd.cpp:8:10: error: ‘n’ was not declared in this scope 8 | cin>>n; | ^ numararesd.cpp:10:9: error: ‘i’ was not declared in this scope 10 | for(i=1;i<=n;i++) cin>>v[i]; | ^ numararesd.cpp:10:28: error: ‘v’ was not declared in this scope 10 | for(i=1;i<=n;i++) cin>>v[i]; | ^ numararesd.cpp:11:9: error: ‘i’ was not declared in this scope 11 | for(i=1;i<=n-1;i++) | ^ numararesd.cpp:12:9: error: ‘j’ was not declared in this scope 12 | for(j=i+1;j<=n;j++) | ^ numararesd.cpp:14:9: error: ‘x’ was not declared in this scope 14 | x=v[i]; | ^ numararesd.cpp:14:11: error: ‘v’ was not declared in this scope 14 | x=v[i]; | ^ numararesd.cpp:15:9: error: ‘sx’ was not declared in this scope 15 | sx=0; | ^~ numararesd.cpp:16:9: error: ‘sy’ was not declared in this scope 16 | sy=0 | ^~ numararesd.cpp:24:17: error: ‘y’ was not declared in this scope 24 | for(i=1;i*i<y;i++) | ^ numararesd.cpp:29:8: error: ‘sx’ was not declared in this scope 29 | if(sx==sy)c=c+1; | ^~ numararesd.cpp:29:12: error: ‘sy’ was not declared in this scope 29 | if(sx==sy)c=c+1; | ^~ numararesd.cpp:29:15: error: ‘c’ was not declared in this scope 29 | if(sx==sy)c=c+1; | ^ numararesd.cpp:30:11: error: ‘c’ was not declared in this scope 30 | cout<<c; | ^ numararesd.cpp:30:13: error: expected ‘}’ at end of input 30 | cout<<c; | ^ numararesd.cpp:6:1: note: to match this ‘{’ 6 | { | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema NumarareSD 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ă.