#2807
Matrice10
Scrieți un program care citește de la tastatură două numere naturale din intervalul [2,50]
, n
și m
, și elementele unui tablou bidimensional cu n
linii și m
coloane, numere naturale distincte din intervalul [0,10
4
]
.
Programul interschimbă valoarea minimă din ultima coloană a tabloului cu valoarea minimă din prima coloană a tabloului, apoi afișează pe ecran tabloul modificat, câte o linie a tabloului pe câte o linie a ecranului, elementele fiecărei linii fiind separate prin câte un spațiu.
Subiect Bacalaureat 2017, sesiune iunie-iulie, subiect de rezervă
Problema | Matrice10 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #39755821 | Utilizator | |
Fișier | matrice10.cpp | Dimensiune | 1.51 KB |
Data încărcării | 17 Noiembrie 2022, 08:50 | Scor / rezultat | Eroare de compilare |
matrice10.cpp:1:7: error: expected nested-name-specifier before 'System' using System; ^ matrice10.cpp:1:7: error: 'System' has not been declared matrice10.cpp:2:7: error: expected nested-name-specifier before 'System' using System.Collections.Generic; ^ matrice10.cpp:2:7: error: 'System' has not been declared matrice10.cpp:2:13: error: expected ';' before '.' token using System.Collections.Generic; ^ matrice10.cpp:2:13: error: expected unqualified-id before '.' token matrice10.cpp:3:7: error: expected nested-name-specifier before 'System' using System.Linq; ^ matrice10.cpp:3:7: error: 'System' has not been declared matrice10.cpp:3:13: error: expected ';' before '.' token using System.Linq; ^ matrice10.cpp:3:13: error: expected unqualified-id before '.' token matrice10.cpp:4:7: error: expected nested-name-specifier before 'System' using System.Text; ^ matrice10.cpp:4:7: error: 'System' has not been declared matrice10.cpp:4:13: error: expected ';' before '.' token using System.Text; ^ matrice10.cpp:4:13: error: expected unqualified-id before '.' token matrice10.cpp:5:7: error: expected nested-name-specifier before 'System' using System.Threading.Tasks; ^ matrice10.cpp:5:7: error: 'System' has not been declared matrice10.cpp:5:13: error: expected ';' before '.' token using System.Threading.Tasks; ^ matrice10.cpp:5:13: error: expected unqualified-id before '.' token matrice10.cpp:11:26: error: 'string' has not been declared static void Main(string[] args) ^ matrice10.cpp:11:35: error: expected ',' or '...' before 'args' static void Main(string[] args) ^ matrice10.cpp:57:5: error: expected ';' after class definition } ^ matrice10.cpp: In static member function 'static void matrice10::Program::Main(int*)': matrice10.cpp:13:16: error: expected unqualified-id before '[' token int[,] a = new int[50, 50]; ^ matrice10.cpp:16:13: error: 'string' was not declared in this scope string s = Console.ReadLine(); ^ matrice10.cpp:16:20: error: expected ';' before 's' string s = Console.ReadLine(); ^ matrice10.cpp:17:20: error: expected primary-expression before ']' token string[] nr = s.Split(); ^ matrice10.cpp:17:22: error: expected ';' before 'nr' string[] nr = s.Split(); ^ matrice10.cpp:19:17: error: expected primary-expression before 'int' n = int.Parse(nr[0]); ^ matrice10.cpp:19:17: error: expected ';' before 'int' matrice10.cpp:20:17: error: expected primary-expression before 'int' m = int.Parse(nr[1]); ^ matrice10.cpp:20:17: error: expected ';' before 'int' matrice10.cpp:24:17: error: 's' was not declared in this scope s = Console.ReadLine(); ^ matrice10.cpp:24:21: error: 'Console' was not declared in this scope s = Console.ReadLine(); ^ matrice10.cpp:25:17: error: 'nr' was not declared in this scope nr = s.Split(); ^ matrice10.cpp:29:21: error: 'a' was not declared in this scope a[i, j] = int.Parse(nr[j]); ^ matrice10.cpp:29:26: warning: left operand of comma operator has no effect [-Wunused-value] a[i, j] = int.Parse(nr[j]); ^ matrice10.cpp:29:31: error: expected primary-expression before 'int' a[i, j] = int.Parse(nr[j]); ^ matrice10.cpp:29:31: error: expected ';' before 'int' matrice10.cpp:31:40: warning: left operand of comma operator has no effect [-Wunused-value] if (j == 0 && a[i, j] < minPrim) ^ matrice10.cpp:33:40: warning: left operand of comma operator has no effect [-Wunused-value] minPrim = a[i, j]; ^ matrice10.cpp:36:49: warning: left operand of comma operator has no effect [-Wunused-value] else if (j == m - 1 && a[i, j] < minUlt) ^ matrice10.cpp:38:39: warning: left operand of comma operator has no effect [-Wunused-value] minUlt = a[i, j]; ^ matrice10.cpp:44:23: error: 'a' was not declared in this scope int tmp = a[minUlti, m - 1]; ^ matrice10.cpp:44:38: warning: left operand of comma operator has no effect [-Wunused-value] int tmp = a[minUlti, m - 1]; ^ matrice10.cpp:45:28: warning: left operand of comma operator has no effect [-Wunused-value] a[minUlti, m - 1] = a[minPrimi, 0]; ^ matrice10.cpp:45:45: warning: left operand of comma operator has no effect [-Wunused-value] a[minUlti, m - 1] = a[minPrimi, 0]; ^ matrice10.cpp:46:25: warning: left operand of comma operator has no effect [-Wunused-value] a[minPrimi, 0] = tmp; ^ matrice10.cpp:51:21: error: 'Console' was not declared in this scope Console.Write(a[i, j] + " "); ^ matrice10.cpp:51:40: warning: left operand of comma operator has no effect [-Wunused-value] Console.Write(a[i, j] + " "); ^ matrice10.cpp:52:17: error: 'Console' was not declared in this scope Console.Write("\n"); ^ matrice10.cpp:55:13: error: 'Console' was not declared in this scope Console.ReadLine(); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Matrice10 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ă.