#include<iostream>
#include<queue>
using namespace std;
int N;
int map[101][101];
int main() {
cin >> N;
char k;
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
cin >> k;
if (k == '.') map[i][j] = 1;
else map[i][j] = 0;
}
}
int cnt_row = 0;
int row = 0;
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
if (map[i][j] == 1)cnt_row++;
else cnt_row = 0;
if (cnt_row == 2)
row ++;
}
cnt_row = 0;
}
int col = 0;
int cnt_col = 0;
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
if (map[j][i] == 1)cnt_col++;
else cnt_col = 0;
if (cnt_col== 2)
col++;
}
cnt_col = 0;
}
cout << row << " " << col;
return 0;
}
'Programming > BOJ' 카테고리의 다른 글
[백준/C++] 백준 1759번 : 암호만들기 (0) | 2020.07.28 |
---|---|
[백준/C++] 백준 1931번: 회의실배정 (0) | 2020.07.20 |
[백준/C++] 백준 1697번: 숨바꼭질 (0) | 2020.07.16 |
[백준/C++] 1260번: DFS와 BFS (0) | 2020.07.13 |
[백준/C++] 1205: 등수구하기 (0) | 2020.07.13 |