#286
Se dă un număr natural n. Construiţi o matrice pătratică de dimensiune n, în care elementele fiecărui chenar sunt egale cu numărul de ordine al chenarului.
| Problema | Chenare | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #63917822 | Utilizator | |
| Fișier | chenare.cpp | Dimensiune | 520 B |
| Data încărcării | 26 Martie 2026, 13:38 | Scor/rezultat | Eroare de compilare |
chenare.cpp: In function 'int main()': chenare.cpp:3:5: error: 'cin' was not declared in this scope cin>>n; ^ chenare.cpp:3:10: error: 'n' was not declared in this scope cin>>n; ^ chenare.cpp:6:9: error: 'nrc' was not declared in this scope nrc=n/2; ^ chenare.cpp:8:11: error: 'nrc' was not declared in this scope else {nrc=n/2+1;} ^ chenare.cpp:9:9: error: 'k' was not declared in this scope for(k=1;k<=nrc;k++) ^ chenare.cpp:9:16: error: 'nrc' was not declared in this scope for(k=1;k<=nrc;k++) ^ chenare.cpp:11:13: error: 'j' was not declared in this scope for(j=k;j<=n-k;j++) ^ chenare.cpp:13:13: error: 'a' was not declared in this scope a[k][j]=k; ^ chenare.cpp:16:13: error: 'i' was not declared in this scope for(i=k;i<=n-k+1;i++) ^ chenare.cpp:18:13: error: 'a' was not declared in this scope a[i][k]=k; ^ chenare.cpp:21:13: error: 'i' was not declared in this scope for(i=1;i<=n;i++) ^ chenare.cpp:23:17: error: 'j' was not declared in this scope for(j=1;j<=n;j++) ^ chenare.cpp:25:17: error: 'cout' was not declared in this scope cout<<a[i][j]<< " "; ^ chenare.cpp:25:23: error: 'a' was not declared in this scope cout<<a[i][j]<< " "; ^ chenare.cpp:28:13: error: 'cout' was not declared in this scope cout<<endl; ^ chenare.cpp:28:19: error: 'endl' was not declared in this scope cout<<endl; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Chenare 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ă.