#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 | #64185069 | Utilizator | |
| Fișier | cmmdcsum.cpp | Dimensiune | 410 B |
| Data încărcării | 22 Aprilie 2026, 08:33 | Scor/rezultat | Eroare de compilare |
cmmdcsum.cpp: In function ‘int main()’: cmmdcsum.cpp:7:18: error: expected ‘;’ before ‘<=’ token 7 | for(int j<=n; j<=n; ++j){ | ^~ | ; cmmdcsum.cpp:7:18: error: expected primary-expression before ‘<=’ token 7 | for(int j<=n; j<=n; ++j){ | ^~ cmmdcsum.cpp:7:24: warning: for increment expression has no effect [-Wunused-value] 7 | for(int j<=n; j<=n; ++j){ | ~^~~ cmmdcsum.cpp:7:27: error: expected ‘)’ before ‘;’ token 7 | for(int j<=n; j<=n; ++j){ | ~ ^ | ) cmmdcsum.cpp:7:9: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 7 | for(int j<=n; j<=n; ++j){ | ^~~ cmmdcsum.cpp:7:29: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 7 | for(int j<=n; j<=n; ++j){ | ^~ cmmdcsum.cpp:6:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 6 | for(int i=1; i<=n; ++i) | ^~~ cmmdcsum.cpp:7:29: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 7 | for(int j<=n; j<=n; ++j){ | ^~ cmmdcsum.cpp:7:31: error: ‘j’ was not declared in this scope 7 | for(int j<=n; j<=n; ++j){ | ^
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ă.