#4086
Se dă un șir a1, a2, …, an de numere naturale nenule. Să se determine răspunsul pentru una din următoarele cerințe:
n numere.n-1 elemente din șir.n-2 elemente din șir.OJI 2022, Clasa a VI-a
| Problema | cmmdc5 | Operații I/O |
cmmdc.in/cmmdc.out
|
|---|---|---|---|
| Limita timp | 0.5 secunde | Limita memorie |
Total: 128 MB
/
Stivă 64 MB
|
| Id soluție | #64686816 | Utilizator | |
| Fișier | cmmdc5.cpp | Dimensiune | 2.17 KB |
| Data încărcării | 22 Mai 2026, 22:05 | Scor/rezultat | Eroare de compilare |
cmmdc5.cpp: In function ‘int main()’: cmmdc5.cpp:36:14: error: ‘v’ was not declared in this scope 36 | fin>>v[i]; | ^ cmmdc5.cpp:38:9: error: ‘pref’ was not declared in this scope 38 | pref[1]=v[1]; | ^~~~ cmmdc5.cpp:38:17: error: ‘v’ was not declared in this scope 38 | pref[1]=v[1]; | ^ cmmdc5.cpp:42:9: error: ‘suff’ was not declared in this scope 42 | suff[n]=v[n]; | ^~~~ cmmdc5.cpp:32:9: warning: unused variable ‘T’ [-Wunused-variable] 32 | int T,n; | ^ cmmdc5.cpp:65:9: error: ‘pref’ was not declared in this scope 65 | pref[1]=v[1]; | ^~~~ cmmdc5.cpp:65:17: error: ‘v’ was not declared in this scope 65 | pref[1]=v[1]; | ^ cmmdc5.cpp:66:22: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long long unsigned int’ [-Wsign-compare] 66 | for(int i=1;i<=n;i++) { | ~^~~ cmmdc5.cpp:69:9: error: ‘suff’ was not declared in this scope 69 | suff[n]=v[n]; | ^~~~ cmmdc5.cpp:73:9: error: ‘rasp’ was not declared in this scope 73 | rasp=0; | ^~~~ cmmdc5.cpp:74:22: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long long unsigned int’ [-Wsign-compare] 74 | for(int i=1;i<=n;i++) { | ~^~~ cmmdc5.cpp:75:28: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long long unsigned int’ [-Wsign-compare] 75 | for(int j=i+1;j<=n;j++) { | ~^~~ cmmdc5.cpp:83:21: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long long unsigned int’ [-Wsign-compare] 83 | if(j==n) { | ~^~~ cmmdc5.cpp:100:2: error: expected ‘}’ at end of input 100 | } | ^ cmmdc5.cpp:16:1: note: to match this ‘{’ 16 | { | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema cmmdc5 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ă.