#include
using namespace std;
int main() {
int m=6;
int n=12;
int k=0;
char chars[m][n];
string st[m] = {
"###...??..+.",
"###.=.??..+.",
"###.......+.",
".....???....",
"???.......==",
"???...####.."
};
for (int i=0;i for (int j=0; j chars[i][j] = st[i][j];
cout << chars[i][j];<br> }
cout << "\n";<br> }
if (chars[0][0] != '.') k++;
for (int j=1; j if ((chars[0][j] !='.')&&(chars[0][j-1] != chars[0][j])) k++;
for (int i=1;i if ((chars[i][0] != '.')&&(chars[i-1][0] != chars[i][0])) k++;
for (int j=1; j if ((chars[i][j] !='.')&&
(chars[i][j-1] != chars[i][j])&&
(chars[i-1][j] != chars[i][j])) k++;
}
cout << k;<br> return 0;
}
Результат (для данного примера):
###...??..+.
###.=.??..+.
###.......+.
.....???....
???.......==
???...####..
8