Your mistake is here
cin>>*ptr[i][j];
that should be
cin>>(*ptr)[i][j];
and the same error here
cout<<*ptr[i][j];
that should be
cout<<(*ptr)[i][j];
But why are you using ptr
why not just use Mat
instead?
cin>>Mat[i][j];
cout<<Mat[i][j];
What do you think is the benefit of using a pointer to your matrix, why not just use the matrix itself?
Note that your code isn't a matrix using pointers, its a pointer to a matrix, which is not the same thing at all. So maybe you've misunderstood what you have been asked to do.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…