#3124
PatratMagic0
Se dă un număr natural n
, urmat de o matrice pătratică cu n * n
elemente, numere naturale. Să se verifice dacă matricea dată este un pătrat magic.
Problema | PatratMagic0 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.2 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54255370 | Utilizator | |
Fișier | patratmagic0.cpp | Dimensiune | 1.15 KB |
Data încărcării | 23 Noiembrie 2024, 16:50 | Scor / rezultat | Eroare de compilare |
patratmagic0.cpp:1:10: error: #include expects "FILENAME" or <FILENAME> #include <iostream> ^ patratmagic0.cpp: In function 'int main()': patratmagic0.cpp:6:1: error: 'cin' was not declared in this scope cin>>n; ^ patratmagic0.cpp:6:5: error: 'gt' was not declared in this scope cin>>n; ^ patratmagic0.cpp:6:13: warning: statement has no effect [-Wunused-value] cin>>n; ^ patratmagic0.cpp:7:11: error: 'lt' was not declared in this scope for(i=1;i<=n;i++)///citim matricea ^ patratmagic0.cpp:7:14: error: expected primary-expression before '=' token for(i=1;i<=n;i++)///citim matricea ^ patratmagic0.cpp:7:16: error: expected ')' before ';' token for(i=1;i<=n;i++)///citim matricea ^ patratmagic0.cpp:7:20: error: expected ';' before ')' token for(i=1;i<=n;i++)///citim matricea ^ patratmagic0.cpp:8:11: error: 'lt' was not declared in this scope for(j=1;j<=n;j++) ^ patratmagic0.cpp:8:14: error: expected primary-expression before '=' token for(j=1;j<=n;j++) ^ patratmagic0.cpp:8:20: error: expected ';' before ')' token for(j=1;j<=n;j++) ^ patratmagic0.cpp:9:18: warning: statement has no effect [-Wunused-value] cin>>a[i][j]; ^ patratmagic0.cpp:10:14: error: expected primary-expression before '=' token for(i=1;i<=n;i++)///calculam suma pe fiecare linie si o slavam pe capat de ^ patratmagic0.cpp:10:16: error: expected ')' before ';' token for(i=1;i<=n;i++)///calculam suma pe fiecare linie si o slavam pe capat de ^ patratmagic0.cpp:10:20: error: expected ';' before ')' token for(i=1;i<=n;i++)///calculam suma pe fiecare linie si o slavam pe capat de ^ patratmagic0.cpp:17:14: error: expected primary-expression before '=' token for(j=1;j<=n;j++)///calculam suma pe fiecare coloana si o salvam pe capat de ^ patratmagic0.cpp:17:16: error: expected ')' before ';' token for(j=1;j<=n;j++)///calculam suma pe fiecare coloana si o salvam pe capat de ^ patratmagic0.cpp:17:20: error: expected ';' before ')' token for(j=1;j<=n;j++)///calculam suma pe fiecare coloana si o salvam pe capat de ^ patratmagic0.cpp:25:14: error: expected primary-expression before '=' token for(i=1;i<=n;i++)///calculam suma pe diagonala principala si o retin in a[0][0] ^ patratmagic0.cpp:25:16: error: expected ')' before ';' token for(i=1;i<=n;i++)///calculam suma pe diagonala principala si o retin in a[0][0] ^ patratmagic0.cpp:25:20: error: expected ';' before ')' token for(i=1;i<=n;i++)///calculam suma pe diagonala principala si o retin in a[0][0] ^ patratmagic0.cpp:28:14: error: expected primary-expression before '=' token for(i=1;i<=n;i++)///calculam suma pe d.s si o retin in a[0][n+1] ^ patratmagic0.cpp:28:16: error: expected ')' before ';' token for(i=1;i<=n;i++)///calculam suma pe d.s si o retin in a[0][n+1] ^ patratmagic0.cpp:28:20: error: expected ';' before ')' token for(i=1;i<=n;i++)///calculam suma pe d.s si o retin in a[0][n+1] ^ patratmagic0.cpp:31:14: error: expected primary-expression before '=' token for(i=0;i<=n && ok==1;i++) ^ patratmagic0.cpp:31:18: error: 'amp' was not declared in this scope for(i=0;i<=n && ok==1;i++) ^ patratmagic0.cpp:31:21: error: expected ')' before ';' token for(i=0;i<=n && ok==1;i++) ^ patratmagic0.cpp:31:23: error: 'amp' was not declared in this scope for(i=0;i<=n && ok==1;i++) ^ patratmagic0.cpp:31:30: warning: statement has no effect [-Wunused-value] for(i=0;i<=n && ok==1;i++) ^ patratmagic0.cpp:31:37: error: expected ';' before ')' token for(i=0;i<=n && ok==1;i++) ^ patratmagic0.cpp:35:14: error: expected ')' before ';' token if(ok==1 && a[0][n+1]!=cpm)///daca suma pe d.s nu e egala cu cpm ^ patratmagic0.cpp:35:35: error: expected ';' before ')' token if(ok==1 && a[0][n+1]!=cpm)///daca suma pe d.s nu e egala cu cpm ^ patratmagic0.cpp:35:30: warning: statement has no effect [-Wunused-value] if(ok==1 && a[0][n+1]!=cpm)///daca suma pe d.s nu e egala cu cpm ^ patratmagic0.cpp:39:1: error: 'cout' was not declared in this scope cout<<"true"; ^ patratmagic0.cpp:39:14: error: 'quot' was not declared in this scope cout<<"true"; ^ patratmagic0.cpp:40:1: error: 'else' without a previous 'if' else ^ patratmagic0.cpp:41:1: error: 'cout' was not declared in this scope cout<<"false"; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema PatratMagic0 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ă.