Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;

/*
class Kuro_siro{
public:
	int kuro;
	int siro;
	Kuro_siro(int _kuro,int _siro){
		kuro=_kuro;
		siro=_siro;
	}
};
vector<Kuro_siro> kuro_siro;
*/

int h,w;
string s[500];
int kuro;
int siro;

void tansaku_kuro(int,int);
void tansaku_siro(int,int);


void tansaku_kuro(int x,int y){
	if(s[x-1][y]=="."){
		s[x-1][y]="A";
		siro++;
		tansaku_siro(x-1,y);
	}
	if(s[x+1][y]=="."){
		s[x+1][y]="A";
		siro++;
		tansaku_siro(x+1,y);
	}
	if(s[x][y-1]=="."){
		s[x][y-1]="A";
		siro++;
		tansaku_siro(x,y-1);
	}
	if(s[x][y+1]=="."){
		s[x][y+1]="A";
		siro++;
		tansaku_siro(x,y+1);
	}
}
void tansaku_siro(int x,int y){
	if(s[x-1][y]=="#"){
		s[x-1][y]="B";
		kuro++;
		tansaku_kuro(x-1,y);
	}
	if(s[x+1][y]=="#"){
		s[x+1][y]="B";
		kuro++;
		tansaku_kuro(x+1,y);
	}
	if(s[x][y-1]=="#"){
		s[x][y-1]="B";
		kuro++;
		tansaku_kuro(x,y-1);
	}
	if(s[x][y+1]=="#"){
		s[x][y+1]="B";
		kuro++;
		tansaku_kuro(x,y+1);
	}
}


main(){
	cin >> h >> w;
	for(int i=0;i<h;i++){
		cin >> s[i];
	}
	long long int ans=0;
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){

			if(s[i][j]=="#"){
				kuro=0;
				siro=0;
				kuro++;
				tansaku_kuro(i,j);
				ans+=kuro*siro;
			}
		}
	}
	cout << ans <<endl;
}


Compiler output:
a.cc: In function 'void tansaku_kuro(int, int)':
a.cc:30:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   30 |         if(s[x-1][y]=="."){
a.cc:31:27: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   31 |                 s[x-1][y]="A";
      |                           ^~~
      |                           |
      |                           const char*
a.cc:35:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   35 |         if(s[x+1][y]=="."){
a.cc:36:27: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   36 |                 s[x+1][y]="A";
      |                           ^~~
      |                           |
      |                           const char*
a.cc:40:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   40 |         if(s[x][y-1]=="."){
a.cc:41:27: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   41 |                 s[x][y-1]="A";
      |                           ^~~
      |                           |
      |                           const char*
a.cc:45:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   45 |         if(s[x][y+1]=="."){
a.cc:46:27: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   46 |                 s[x][y+1]="A";
      |                           ^~~
      |                           |
      |                           const char*
a.cc: In function 'void tansaku_siro(int, int)':
a.cc:52:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   52 |         if(s[x-1][y]=="#"){
a.cc:53:27: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   53 |                 s[x-1][y]="B";
      |                           ^~~
      |                           |
      |                           const char*
a.cc:57:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   57 |         if(s[x+1][y]=="#"){
a.cc:58:27: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   58 |                 s[x+1][y]="B";
      |                           ^~~
      |                           |
      |                           const char*
a.cc:62:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   62 |         if(s[x][y-1]=="#"){
a.cc:63:27: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   63 |                 s[x][y-1]="B";
      |                           ^~~
      |                           |
      |                           const char*
a.cc:67:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   67 |         if(s[x][y+1]=="#"){
a.cc:68:27: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   68 |                 s[x][y+1]="B";
      |                           ^~~
      |                           |
      |                           const char*
a.cc: At global scope:
a.cc:75:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   75 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:84:35: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   84 |                         if(s[i][j]=="#"){