#780
CmmdcSum
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 |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #51359263 | Utilizator | |
Fișier | cmmdcsum.cpp | Dimensiune | 587 B |
Data încărcării | 10 Iunie 2024, 14:42 | Scor / rezultat | Eroare de compilare |
cmmdcsum.cpp:3:11: error: 'a' was not declared in this scope int cmmdc(a,b),r,d; ^ cmmdcsum.cpp:3:13: error: 'b' was not declared in this scope int cmmdc(a,b),r,d; ^ cmmdcsum.cpp:3:14: error: expression list treated as compound expression in initializer [-fpermissive] int cmmdc(a,b),r,d; ^ cmmdcsum.cpp: In function 'int main()': cmmdcsum.cpp:7:11: error: 'b' was not declared in this scope while(b!=0) ^ cmmdcsum.cpp:9:11: error: 'a' was not declared in this scope r=a%b; ^ cmmdcsum.cpp:13:7: error: 'a' was not declared in this scope d=a; ^ cmmdcsum.cpp:16:5: error: 'in' was not declared in this scope in , m , a[101][101] , s = 0 , smax = 0 , d = 0; ^ cmmdcsum.cpp:16:10: error: 'm' was not declared in this scope in , m , a[101][101] , s = 0 , smax = 0 , d = 0; ^ cmmdcsum.cpp:16:28: error: 's' was not declared in this scope in , m , a[101][101] , s = 0 , smax = 0 , d = 0; ^ cmmdcsum.cpp:16:36: error: 'smax' was not declared in this scope in , m , a[101][101] , s = 0 , smax = 0 , d = 0; ^ cmmdcsum.cpp:17:12: error: 'n' was not declared in this scope cin >> n ; ^ cmmdcsum.cpp:28:29: error: 'cmmdc' cannot be used as a function cout << cmmdc(s,smax-s-d); ^ cmmdcsum.cpp:28:30: error: expected '}' at end of input cout << cmmdc(s,smax-s-d); ^ cmmdcsum.cpp:28:30: error: expected '}' at end of input
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ă.