#1749
Zona4
Considerăm o matrice pătratică cu N
linii și N
coloane. În această matrice sunt definite 4
zone:
1
, formată din elementele situate strict deasupra diagonalei principale și strict deasupra diagonalei secundare;2
, formată din elementele situate strict deasupra diagonalei principale și strict sub diagonala secundară;3
, formată din elementele situate strict sub diagonala principală și strict sub diagonala secundară;4
, formată din elementele situate strict sub diagonala principală și strict deasupra diagonalei secundare;Se dă o matrice pătratică și un număr natural Z
, reprezentând o zonă din matrice. Să se determine suma elementelor din zona Z
.
Problema | Zona4 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #39763267 | Utilizator | |
Fișier | zona4.cpp | Dimensiune | 1.47 KB |
Data încărcării | 17 Noiembrie 2022, 11:45 | Scor / rezultat | Eroare de compilare |
zona4.cpp:1:7: error: expected nested-name-specifier before 'System' using System; ^ zona4.cpp:1:7: error: 'System' has not been declared zona4.cpp:2:7: error: expected nested-name-specifier before 'System' using System.Collections.Generic; ^ zona4.cpp:2:7: error: 'System' has not been declared zona4.cpp:2:13: error: expected ';' before '.' token using System.Collections.Generic; ^ zona4.cpp:2:13: error: expected unqualified-id before '.' token zona4.cpp:3:7: error: expected nested-name-specifier before 'System' using System.Linq; ^ zona4.cpp:3:7: error: 'System' has not been declared zona4.cpp:3:13: error: expected ';' before '.' token using System.Linq; ^ zona4.cpp:3:13: error: expected unqualified-id before '.' token zona4.cpp:4:7: error: expected nested-name-specifier before 'System' using System.Text; ^ zona4.cpp:4:7: error: 'System' has not been declared zona4.cpp:4:13: error: expected ';' before '.' token using System.Text; ^ zona4.cpp:4:13: error: expected unqualified-id before '.' token zona4.cpp:5:7: error: expected nested-name-specifier before 'System' using System.Threading.Tasks; ^ zona4.cpp:5:7: error: 'System' has not been declared zona4.cpp:5:13: error: expected ';' before '.' token using System.Threading.Tasks; ^ zona4.cpp:5:13: error: expected unqualified-id before '.' token zona4.cpp:13:16: error: 'Tuple' does not name a type static Tuple<int, int> Sign(int z) ^ zona4.cpp:27:26: error: 'string' has not been declared static void Main(string[] args) ^ zona4.cpp:27:35: error: expected ',' or '...' before 'args' static void Main(string[] args) ^ zona4.cpp:57:5: error: expected ';' after class definition } ^ zona4.cpp: In static member function 'static void ConsoleApplication1::Program::Main(int*)': zona4.cpp:29:16: error: expected unqualified-id before '[' token int[,] a = new int[200, 200]; ^ zona4.cpp:32:13: error: 'string' was not declared in this scope string p = Console.ReadLine(); ^ zona4.cpp:32:20: error: expected ';' before 'p' string p = Console.ReadLine(); ^ zona4.cpp:33:20: error: expected primary-expression before ']' token string[] nr = p.Split(); ^ zona4.cpp:33:22: error: expected ';' before 'nr' string[] nr = p.Split(); ^ zona4.cpp:35:17: error: expected primary-expression before 'int' n = int.Parse(nr[0]); ^ zona4.cpp:35:17: error: expected ';' before 'int' zona4.cpp:36:17: error: expected primary-expression before 'int' z = int.Parse(nr[1]); ^ zona4.cpp:36:17: error: expected ';' before 'int' zona4.cpp:37:13: error: 'Tuple' was not declared in this scope Tuple<int, int> sgn = Sign(z); ^ zona4.cpp:37:19: error: expected primary-expression before 'int' Tuple<int, int> sgn = Sign(z); ^ zona4.cpp:37:19: error: expected ';' before 'int' zona4.cpp:38:20: error: 'sgn' was not declared in this scope sgn1 = sgn.Item1; ^ zona4.cpp:43:17: error: 'p' was not declared in this scope p = Console.ReadLine(); ^ zona4.cpp:43:21: error: 'Console' was not declared in this scope p = Console.ReadLine(); ^ zona4.cpp:44:17: error: 'nr' was not declared in this scope nr = p.Split(); ^ zona4.cpp:48:21: error: 'a' was not declared in this scope a[i, j] = int.Parse(nr[j]); ^ zona4.cpp:48:26: warning: left operand of comma operator has no effect [-Wunused-value] a[i, j] = int.Parse(nr[j]); ^ zona4.cpp:48:31: error: expected primary-expression before 'int' a[i, j] = int.Parse(nr[j]); ^ zona4.cpp:48:31: error: expected ';' before 'int' zona4.cpp:51:35: warning: left operand of comma operator has no effect [-Wunused-value] s += a[i, j]; ^ zona4.cpp:55:13: error: 'Console' was not declared in this scope Console.Write(s); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Zona4 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ă.