#781
Zone1
Se dă o matrice cu n
linii şi n
coloane şi elemente numere naturale. Să se afişeze, în ordine crescătoare, sumele elementelor din cele patru zone delimitate de diagonale.
Problema | Zone1 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #17360325 | Utilizator | |
Fișier | zone1.cpp | Dimensiune | 758 B |
Data încărcării | 08 Octombrie 2019, 13:01 | Scor / rezultat | Eroare de compilare |
zone1.cpp: In function 'int main()': zone1.cpp:14:1: error: 'l' was not declared in this scope l s[1]=s[1]+a[i][j]; ^ zone1.cpp:14:10: error: expected ';' before 's' l s[1]=s[1]+a[i][j]; ^ zone1.cpp:16:11: error: 's' was not declared in this scope s[2]=s[2]+a[i][j]; ^ zone1.cpp:18:11: error: 's' was not declared in this scope s[3]=s[3]+a[i][j]; ^ zone1.cpp:20:10: error: 's' was not declared in this scope s[4]=s[4]+a[i][j];} ^ zone1.cpp:21:11: error: 's' was not declared in this scope v[1]=s[1]; ^ zone1.cpp:25:16: error: expected ';' before ':' token for(i=1;i<4:i++) ^ zone1.cpp:25:16: error: expected primary-expression before ':' token zone1.cpp:25:16: error: expected ')' before ':' token zone1.cpp:25:16: error: expected primary-expression before ':' token zone1.cpp:25:16: error: expected ';' before ':' token zone1.cpp:26:20: warning: statement has no effect [-Wunused-value] for(j=i+1;j<=4;j++) ^ zone1.cpp:26:27: error: expected ';' before ')' token for(j=i+1;j<=4;j++) ^ zone1.cpp:32:22: error: expected primary-expression before '<<' token cout<<v[1]<<" "<<<<v[2]<<" "<<v[3]<<" "<<v[4]<<" "; ^ zone1.cpp:6:27: warning: unused variable 's1' [-Wunused-variable] { int a[101][101],i,j,n,s1=0,s2=0,s3=0,s4=0,aux=0,v[5]={}; ^ zone1.cpp:6:32: warning: unused variable 's2' [-Wunused-variable] { int a[101][101],i,j,n,s1=0,s2=0,s3=0,s4=0,aux=0,v[5]={}; ^ zone1.cpp:6:37: warning: unused variable 's3' [-Wunused-variable] { int a[101][101],i,j,n,s1=0,s2=0,s3=0,s4=0,aux=0,v[5]={}; ^ zone1.cpp:6:42: warning: unused variable 's4' [-Wunused-variable] { int a[101][101],i,j,n,s1=0,s2=0,s3=0,s4=0,aux=0,v[5]={}; ^ zone1.cpp:6:47: warning: unused variable 'aux' [-Wunused-variable] { int a[101][101],i,j,n,s1=0,s2=0,s3=0,s4=0,aux=0,v[5]={}; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Zone1 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ă.