#2877
SortMatrixLinCol
Se dă o matrice pătratică de dimensiune n
. Să se ordoneze crescător fiecare linie a matricei, apoi să se ordoneze crescător fiecare coloană a acesteia.
Problema | SortMatrixLinCol | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 1 MB
/
Stivă 1 MB
|
Id soluție | #54223477 | Utilizator | |
Fișier | sortmatrixlincol.cpp | Dimensiune | 2.14 KB |
Data încărcării | 22 Noiembrie 2024, 15:35 | Scor / rezultat | Eroare de compilare |
sortmatrixlincol.cpp:6:32: error: 'size_t' was not declared in this scope static T **allocate_matrix(size_t rows, size_t cols) ^ sortmatrixlincol.cpp:6:45: error: 'size_t' was not declared in this scope static T **allocate_matrix(size_t rows, size_t cols) ^ sortmatrixlincol.cpp:6:56: error: template declaration of 'T** allocate_matrix' static T **allocate_matrix(size_t rows, size_t cols) ^ sortmatrixlincol.cpp:15:43: error: 'size_t' has not been declared static void delete_matrix(T **matrix, size_t rows, size_t cols) ^ sortmatrixlincol.cpp:15:56: error: 'size_t' has not been declared static void delete_matrix(T **matrix, size_t rows, size_t cols) ^ sortmatrixlincol.cpp:23:50: error: 'size_t' has not been declared static void GetMatrixFromConsole(T **matrix, size_t rows, size_t cols) ^ sortmatrixlincol.cpp:23:63: error: 'size_t' has not been declared static void GetMatrixFromConsole(T **matrix, size_t rows, size_t cols) ^ sortmatrixlincol.cpp:31:47: error: 'size_t' has not been declared static void GetMatrixFromFile(T **matrix, size_t rows, size_t cols, std::ifstream &inputFile) ^ sortmatrixlincol.cpp:31:60: error: 'size_t' has not been declared static void GetMatrixFromFile(T **matrix, size_t rows, size_t cols, std::ifstream &inputFile) ^ sortmatrixlincol.cpp:31:78: error: 'std::ifstream' has not been declared static void GetMatrixFromFile(T **matrix, size_t rows, size_t cols, std::ifstream &inputFile) ^ sortmatrixlincol.cpp:39:56: error: 'size_t' does not name a type static void GetPlaceholderMatrix(T **buffer, const size_t rows, const size_t cols) ^ sortmatrixlincol.cpp:39:63: error: ISO C++ forbids declaration of 'rows' with no type [-fpermissive] static void GetPlaceholderMatrix(T **buffer, const size_t rows, const size_t cols) ^ sortmatrixlincol.cpp:39:75: error: 'size_t' does not name a type static void GetPlaceholderMatrix(T **buffer, const size_t rows, const size_t cols) ^ sortmatrixlincol.cpp:39:82: error: ISO C++ forbids declaration of 'cols' with no type [-fpermissive] static void GetPlaceholderMatrix(T **buffer, const size_t rows, const size_t cols) ^ sortmatrixlincol.cpp:47:40: error: 'size_t' has not been declared static void FillMatrix(T **buffer, size_t rows, size_t cols, const T value) ^ sortmatrixlincol.cpp:47:53: error: 'size_t' has not been declared static void FillMatrix(T **buffer, size_t rows, size_t cols, const T value) ^ sortmatrixlincol.cpp:55:41: error: 'size_t' has not been declared static void PrintMatrix(T **matrix, size_t rows, size_t cols) ^ sortmatrixlincol.cpp:55:54: error: 'size_t' has not been declared static void PrintMatrix(T **matrix, size_t rows, size_t cols) ^ sortmatrixlincol.cpp:66:40: error: 'size_t' has not been declared static void PrintVector(T *vector, size_t size) ^ sortmatrixlincol.cpp: In static member function 'static void Helper::delete_matrix(T**, int, int)': sortmatrixlincol.cpp:17:14: error: 'size_t' was not declared in this scope for (size_t r = 0; r < rows; r++) ^ sortmatrixlincol.cpp:17:21: error: expected ';' before 'r' for (size_t r = 0; r < rows; r++) ^ sortmatrixlincol.cpp:17:28: error: 'r' was not declared in this scope for (size_t r = 0; r < rows; r++) ^ sortmatrixlincol.cpp: In static member function 'static void Helper::GetMatrixFromConsole(T**, int, int)': sortmatrixlincol.cpp:25:14: error: 'size_t' was not declared in this scope for (size_t r = 0; r < rows; r++) ^ sortmatrixlincol.cpp:25:21: error: expected ';' before 'r' for (size_t r = 0; r < rows; r++) ^ sortmatrixlincol.cpp:25:28: error: 'r' was not declared in this scope for (size_t r = 0; r < rows; r++) ^ sortmatrixlincol.cpp:26:25: error: expected ';' before 'c' for (size_t c = 0; c < cols; c++) ^ sortmatrixlincol.cpp:26:32: error: 'c' was not declared in this scope for (size_t c = 0; c < cols; c++) ^ sortmatrixlincol.cpp:27:17: error: 'cin' is not a member of 'std' std::cin >> matrix[r][c]; ^ sortmatrixlincol.cpp: In static member function 'static void Helper::GetMatrixFromFile(T**, int, int, int&)': sortmatrixlincol.cpp:33:14: error: 'size_t' was not declared in this scope for (size_t r = 0; r < rows; r++) ^ sortmatrixlincol.cpp:33:21: error: expected ';' before 'r' for (size_t r = 0; r < rows; r++) ^ sortmatrixlincol.cpp:33:28: error: 'r' was not declared in this scope for (size_t r = 0; r < rows; r++) ^ sortmatrixlincol.cpp:34:25: error: expected ';' before 'c' for (size_t c = 0; c < cols; c++) ^ sortmatrixlincol.cpp:34:32: error: 'c' was not declared in this scope for (size_t c = 0; c < cols; c++) ^ sortmatrixlincol.cpp: In static member function 'static void Helper::GetPlaceholderMatrix(T**, int, int)': sortmatrixlincol.cpp:41:14: error: 'size_t' was not declared in this scope for (size_t r = 0; r < rows; r++) ^ sortmatrixlincol.cpp:41:21: error: expected ';' before 'r' for (size_t r = 0; r < rows; r++) ^ sortmatrixlincol.cpp:41:28: error: 'r' was not declared in this scope for (size_t r = 0; r < rows; r++) ^ sortmatrixlincol.cpp:42:25: error: expected ';' before 'c' for (size_t c = 0; c < cols; c++) ^ sortmatrixlincol.cpp:42:32: error: 'c' was not declared in this scope for (size_t c = 0; c < cols; c++) ^ sortmatrixlincol.cpp: In static member function 'static void Helper::FillMatrix(T**, int, int, T)': sortmatrixlincol.cpp:49:14: error: 'size_t' was not declared in this scope for (size_t r = 0; r < rows; r++) ^ sortmatrixlincol.cpp:49:21: error: expected ';' before 'r' for (size_t r = 0; r < rows; r++) ^ sortmatrixlincol.cpp:49:28: error: 'r' was not declared in this scope for (size_t r = 0; r < rows; r++) ^ sortmatrixlincol.cpp:50:25: error: expected ';' before 'c' for (size_t c = 0; c < cols; c++) ^ sortmatrixlincol.cpp:50:32: error: 'c' was not declared in this scope for (size_t c = 0; c < cols; c++) ^ sortmatrixlincol.cpp: In static member function 'static void Helper::PrintMatrix(T**, int, int)': sortmatrixlincol.cpp:57:14: error: 'size_t' was not declared in this scope for (size_t r = 0; r < rows; r++) ^ sortmatrixlincol.cpp:57:21: error: expected ';' before 'r' for (size_t r = 0; r < rows; r++) ^ sortmatrixlincol.cpp:57:28: error: 'r' was not declared in this scope for (size_t r = 0; r < rows; r++) ^ sortmatrixlincol.cpp:59:25: error: expected ';' before 'c' for (size_t c = 0; c < cols; c++) ^ sortmatrixlincol.cpp:59:32: error: 'c' was not declared in this scope for (size_t c = 0; c < cols; c++) ^ sortmatrixlincol.cpp:60:17: error: 'cout' is not a member of 'std' std::cout << matrix[r][c] << ' '; ^ sortmatrixlincol.cpp:61:13: error: 'cout' is not a member of 'std' std::cout << std::endl; ^ sortmatrixlincol.cpp:61:26: error: 'endl' is not a member of 'std' std::cout << std::endl; ^ sortmatrixlincol.cpp: In static member function 'static void Helper::PrintVector(T*, int)': sortmatrixlincol.cpp:68:14: error: 'size_t' was not declared in this scope for (size_t i = 0; i < size; i++) ^ sortmatrixlincol.cpp:68:21: error: expected ';' before 'i' for (size_t i = 0; i < size; i++) ^ sortmatrixlincol.cpp:68:28: error: 'i' was not declared in this scope for (size_t i = 0; i < size; i++) ^ sortmatrixlincol.cpp:69:13: error: 'cout' is not a member of 'std' std::cout << vector[i] << ' '; ^ sortmatrixlincol.cpp:70:9: error: 'cout' is not a member of 'std' std::cout << std::endl; ^ sortmatrixlincol.cpp:70:22: error: 'endl' is not a member of 'std' std::cout << std::endl; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema SortMatrixLinCol 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ă.