Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;
int h,w;
string s[500];
/*
class Kuro_siro{
public:
	int kuro;
	int siro;
	Kuro_siro(int _kuro,int _siro){
		kuro=_kuro;
		siro=_siro;
	}
};
*/
int kuro;
int siro;
vector<Kuro_siro> kuro_siro;
void tansaku_kuro(int x,int y){
	if(s[x-1][y]=='.'){
		s[x-1][y]='0';
		siro++;
		tansaku_siro(int x-1,int y);
	}
	if(s[x+1][y]=='.'){
		s[x+1][y]='0';
		siro++;
		tansaku_siro(int x+1,int y);
	}
	if(s[x][y-1]=='.'){
		s[x][y-1]='0';
		siro++;
		tansaku_siro(int x,int y-1);
	}
	if(s[x][y+1]=='.'){
		s[x][y+1]='0';
		siro++;
		tansaku_siro(int x,int y+1);
	}
}
void tansaku_siro(int x,int y){
	if(s[x-1][y]=='#'){
		s[x-1][y]='1';
		kuro++;
		tansaku_kuro(int x-1,int y);
	}
	if(s[x+1][y]=='#'){
		s[x+1][y]='1';
		kuro++;
		tansaku_kuro(int x+1,int y);
	}
	if(s[x][y-1]=='#'){
		s[x][y-1]='1';
		kuro++;
		tansaku_kuro(int x,int y-1);
	}
	if(s[x][y+1]=='#'){
		s[x][y+1]='1';
		kuro++;
		tansaku_kuro(int x,int 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:21:8: error: 'Kuro_siro' was not declared in this scope
   21 | vector<Kuro_siro> kuro_siro;
      |        ^~~~~~~~~
a.cc:21:17: error: template argument 1 is invalid
   21 | vector<Kuro_siro> kuro_siro;
      |                 ^
a.cc:21:17: error: template argument 2 is invalid
a.cc: In function 'void tansaku_kuro(int, int)':
a.cc:26:30: error: expected primary-expression before 'int'
   26 |                 tansaku_siro(int x-1,int y);
      |                              ^~~
a.cc:26:38: error: expected primary-expression before 'int'
   26 |                 tansaku_siro(int x-1,int y);
      |                                      ^~~
a.cc:26:17: error: 'tansaku_siro' was not declared in this scope; did you mean 'tansaku_kuro'?
   26 |                 tansaku_siro(int x-1,int y);
      |                 ^~~~~~~~~~~~
      |                 tansaku_kuro
a.cc:31:30: error: expected primary-expression before 'int'
   31 |                 tansaku_siro(int x+1,int y);
      |                              ^~~
a.cc:31:38: error: expected primary-expression before 'int'
   31 |                 tansaku_siro(int x+1,int y);
      |                                      ^~~
a.cc:31:17: error: 'tansaku_siro' was not declared in this scope; did you mean 'tansaku_kuro'?
   31 |                 tansaku_siro(int x+1,int y);
      |                 ^~~~~~~~~~~~
      |                 tansaku_kuro
a.cc:36:30: error: expected primary-expression before 'int'
   36 |                 tansaku_siro(int x,int y-1);
      |                              ^~~
a.cc:36:36: error: expected primary-expression before 'int'
   36 |                 tansaku_siro(int x,int y-1);
      |                                    ^~~
a.cc:36:17: error: 'tansaku_siro' was not declared in this scope; did you mean 'tansaku_kuro'?
   36 |                 tansaku_siro(int x,int y-1);
      |                 ^~~~~~~~~~~~
      |                 tansaku_kuro
a.cc:41:30: error: expected primary-expression before 'int'
   41 |                 tansaku_siro(int x,int y+1);
      |                              ^~~
a.cc:41:36: error: expected primary-expression before 'int'
   41 |                 tansaku_siro(int x,int y+1);
      |                                    ^~~
a.cc:41:17: error: 'tansaku_siro' was not declared in this scope; did you mean 'tansaku_kuro'?
   41 |                 tansaku_siro(int x,int y+1);
      |                 ^~~~~~~~~~~~
      |                 tansaku_kuro
a.cc: In function 'void tansaku_siro(int, int)':
a.cc:48:30: error: expected primary-expression before 'int'
   48 |                 tansaku_kuro(int x-1,int y);
      |                              ^~~
a.cc:48:38: error: expected primary-expression before 'int'
   48 |                 tansaku_kuro(int x-1,int y);
      |                                      ^~~
a.cc:53:30: error: expected primary-expression before 'int'
   53 |                 tansaku_kuro(int x+1,int y);
      |                              ^~~
a.cc:53:38: error: expected primary-expression before 'int'
   53 |                 tansaku_kuro(int x+1,int y);
      |                                      ^~~
a.cc:58:30: error: expected primary-expression before 'int'
   58 |                 tansaku_kuro(int x,int y-1);
      |                              ^~~
a.cc:58:36: error: expected primary-expression before 'int'
   58 |                 tansaku_kuro(int x,int y-1);
      |                                    ^~~
a.cc:63:30: error: expected primary-expression before 'int'
   63 |                 tansaku_kuro(int x,int y+1);
      |                              ^~~
a.cc:63:36: error: expected primary-expression before 'int'
   63 |                 tansaku_kuro(int x,int y+1);
      |                                    ^~~
a.cc: At global scope:
a.cc:68:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   68 | main(){
      | ^~~~