#780
Se dă o matrice cu n linii şi n coloane şi elemente numere naturale. Calculaţi cel mai mare divizor comun al sumei elementelor de deasupra diagonalei principale și al sumei elementelor de sub diagonala principală.
| Problema | CmmdcSum | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64921452 | Utilizator | |
| Fișier | cmmdcsum.cpp | Dimensiune | 682 B |
| Data încărcării | 13 Iunie 2026, 21:41 | Scor/rezultat | Eroare de compilare |
cmmdcsum.cpp: In lambda function: cmmdcsum.cpp:18:24: error: expected ‘{’ before ‘[’ token 18 | p=p+[i][j]; | ^ cmmdcsum.cpp: In function ‘int main()’: cmmdcsum.cpp:18:24: error: no match for ‘operator[]’ (operand types are ‘main()::<lambda()>’ and ‘int’) cmmdcsum.cpp:16:9: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 16 | for(int j=1;j<=n;j++) | ^~~ cmmdcsum.cpp:19:13: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 19 | for(int i=1;i<=n;i++) | ^~~ cmmdcsum.cpp:22:9: error: expected primary-expression before ‘}’ token 22 | } | ^ cmmdcsum.cpp:23:14: error: ‘j’ was not declared in this scope 23 | if(i>j) | ^ cmmdcsum.cpp:27:9: warning: this ‘while’ clause does not guard... [-Wmisleading-indentation] 27 | while(s!=p) | ^~~~~ cmmdcsum.cpp:32:13: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘while’ 32 | cout<<s; | ^~~~ cmmdcsum.cpp:34:2: error: expected ‘}’ at end of input 34 | } | ^ cmmdcsum.cpp:4:1: note: to match this ‘{’ 4 | { | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema CmmdcSum 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ă.