Language: C++

#include <iostream>
using namespace std;

int main(){
    int row, column;
    cin >> row, column;
    int new_row, new_column = row, column;

    vector<vector<int>> data(row, vector<int>(column));

    for (int i = 0; i < row; ++i){
        for (int j = 0; j < column; ++j){
            cin >> data.at(i).at(j);
            
        }
    }


    int counter_row = 0;
    int counter_column = 0;

    for (int i = 0; i < row; ++i){
        for (int j = 0; j < column; ++j){
            if(data.at(i).at(j) == "#")
                counter_row += 1;
             }

        if (counter_row != row - 1) {
            data.at(i).pop_back();
            row -= 1;

            }
        }  


    for (int i = 0; i < column; ++i){
        for (int j = 0; j < row; ++j){
            if(data.at(j).at(i) == "#")
                counter_column += 1;
             }

        if (counter_column != column - 1;) {
            for(int j = 0; j < row; ++j){
                data.at(j).at(i).pop_back();
            }
            
            column -= 1;
            }
        } 


    for (int i = 0; i < new_row.size(); ++i){
        for (int j = 0; j < new_column.size(); ++j){
            
            cout << data.at(i).at(j) << " ";
            
            if(j = row.size() - 1){
                cout << endl;
            }
        }
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:7:36: error: redeclaration of 'int column'
    7 |     int new_row, new_column = row, column;
      |                                    ^~~~~~
a.cc:5:14: note: 'int column' previously declared here
    5 |     int row, column;
      |              ^~~~~~
a.cc:9:5: error: 'vector' was not declared in this scope
    9 |     vector<vector<int>> data(row, vector<int>(column));
      |     ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:9:19: error: expected primary-expression before 'int'
    9 |     vector<vector<int>> data(row, vector<int>(column));
      |                   ^~~
a.cc:13:25: error: overloaded function with no contextual type information
   13 |             cin >> data.at(i).at(j);
      |                         ^~
a.cc:24:21: error: overloaded function with no contextual type information
   24 |             if(data.at(i).at(j) == "#")
      |                     ^~
a.cc:29:18: error: overloaded function with no contextual type information
   29 |             data.at(i).pop_back();
      |                  ^~
a.cc:38:21: error: overloaded function with no contextual type information
   38 |             if(data.at(j).at(i) == "#")
      |                     ^~
a.cc:42:42: error: expected primary-expression before ')' token
   42 |         if (counter_column != column - 1;) {
      |                                          ^
a.cc:44:22: error: overloaded function with no contextual type information
   44 |                 data.at(j).at(i).pop_back();
      |                      ^~
a.cc:52:33: error: request for member 'size' in 'new_row', which is of non-class type 'int'
   52 |     for (int i = 0; i < new_row.size(); ++i){
      |                                 ^~~~
a.cc:53:40: error: request for member 'size' in 'new_column', which is of non-class type 'int'
   53 |         for (int j = 0; j < new_column.size(); ++j){
      |                                        ^~~~
a.cc:55:26: error: overloaded function with no contextual type information
   55 |             cout << data.at(i).at(j) << " ";
      |                          ^~
a.cc:57:24: error: request for member 'size' in 'row', which is of non-class type 'int'
   57 |             if(j = row.size() - 1){
      |                        ^~~~
a.cc:61:6: error: expected '}' at end of input
   61 |     }
      |      ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^