#207
GenMat2
Scrieţi un program care citeşte de la tastatură un număr natural n
şi construieşte în memorie o matrice cu n
linii şi n
coloane ale cărei elemente vor primi valori după cum urmează:
0
n
n-1
1
Variante Bacalaureat 2009
Problema | GenMat2 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #45148436 | Utilizator | |
Fișier | genmat2.cpp | Dimensiune | 692 B |
Data încărcării | 04 Octombrie 2023, 07:40 | Scor / rezultat | Eroare de compilare |
genmat2.cpp:1:7: error: expected nested-name-specifier before 'System' using System; ^ genmat2.cpp:1:7: error: 'System' has not been declared genmat2.cpp:7:26: error: 'string' has not been declared static void Main(string[] args) ^ genmat2.cpp:7:35: error: expected ',' or '...' before 'args' static void Main(string[] args) ^ genmat2.cpp:28:5: error: expected ';' after class definition } ^ genmat2.cpp: In static member function 'static void _207::Program::Main(int*)': genmat2.cpp:11:16: error: expected unqualified-id before '[' token int[,] A = new int[101,101]; ^ genmat2.cpp:12:17: error: expected primary-expression before 'int' n = int.Parse(Console.ReadLine()); ^ genmat2.cpp:12:17: error: expected ';' before 'int' genmat2.cpp:17:25: error: 'A' was not declared in this scope A[i,j] = 0; ^ genmat2.cpp:17:29: warning: left operand of comma operator has no effect [-Wunused-value] A[i,j] = 0; ^ genmat2.cpp:19:25: error: 'A' was not declared in this scope A[i, j] = n - j+ 1; ^ genmat2.cpp:19:30: warning: left operand of comma operator has no effect [-Wunused-value] A[i, j] = n - j+ 1; ^ genmat2.cpp:23:21: error: 'Console' was not declared in this scope Console.Write(A[i, j].ToString() + " "); ^ genmat2.cpp:23:35: error: 'A' was not declared in this scope Console.Write(A[i, j].ToString() + " "); ^ genmat2.cpp:23:40: warning: left operand of comma operator has no effect [-Wunused-value] Console.Write(A[i, j].ToString() + " "); ^ genmat2.cpp:24:13: error: 'Console' was not declared in this scope Console.WriteLine(); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema GenMat2 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ă.