When code reaches this line:
if (d == '1') {//ручной ввод данных в матрицу
it sees curly brace "{" and opens, what is called, a new scope of automatic variable.
Subsequently this line:
//создаем массив
float** matrix = new float* [n];
is the place where the above feature allows for mistake to occur.
If it wasn't for new scope, compiler would have notified you of error, something like "attempt to declare variable, variable matrix already declared"
provided you with error message, line number, and later edition even notify users of possible fix.
All you need to do is to remove
float** inside this if condition
--if (d == '1') {//ручной ввод данных в матрицу--
and error would be mended.
Here is link from
wikipedia. I have red its section "In specific programming languages", subsection "C, C++", and I can confirm that it is speaking truth.