Language: C++

#include <iostream>
#include <string>
#include <vector>                                                                                                                                                                                 
                                                                                                                                                                                                  
int main()                                                                                                                                                                                        
{                                                                                                                                                                                                 
    int h, w;                                                                                                                                                                                     
    std::cin >> a >> b;                                                                                                                                                                           
    std::vector<std::string> ans;                                                                                                                                                                 
                                                                                                                                                                                                  
    for (int i = 0; i < h; ++i) {                                                                                                                                                                 
       std::string s;                                                                                                                                                                            
       std::cin >> s;                                                                                                                                                                            
      if (s != std::string(w, '.') {                                                                                                                                                             
          ans.push_back(s);                                                                                                                                                                     
       }                                                                                                                                                                                         
    }                                                                                                                                                                                             
    for (std::string s : ans) {                                                                                                                                                                   
       std::cout << s << std::endl;                                                                                                                                                              
    }                                                                                                                                                                                             
                                                                                                                                                                                                  
    return 0;                                                                                                                                                                                     
}                                  

Compiler output:
a.cc: In function 'int main()':
a.cc:8:17: error: 'a' was not declared in this scope
    8 |     std::cin >> a >> b;
      |                 ^
a.cc:8:22: error: 'b' was not declared in this scope
    8 |     std::cin >> a >> b;
      |                      ^
a.cc:14:35: error: expected ')' before '{' token
   14 |       if (s != std::string(w, '.') {
      |          ~                        ^~
      |                                   )
a.cc:17:5: error: expected primary-expression before '}' token
   17 |     }
      |     ^