Language: C++

#include <iostream>
#include <string>
#include <vector>                                                                                                                                                                                 
                                                                                                                                                                                                  
int main()                                                                                                                                                                                        
{                                                                                                                                                                                                 
    int h, w;                                                                                                                                                                                     
    std::cin >> h >> w;                                                                                                                                                                           
    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:14:36: error: expected ')' before '{' token
   14 |        if (s != std::string(w, '.') {
      |           ~                        ^~
      |                                    )
a.cc:17:5: error: expected primary-expression before '}' token
   17 |     }
      |     ^