-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1100.cpp
More file actions
40 lines (36 loc) · 764 Bytes
/
Copy path1100.cpp
File metadata and controls
40 lines (36 loc) · 764 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include <iostream>
using namespace std;
//scanf를 쓰니깐 오류가 났었다. enter가 입력되어서
//int main() {
// int count = 0;
// char a[8][8];
// char input;
// for (int i = 0; i < 8; i++) {
// for (int j = 0; j < 8; j++) {
// cin >> input;
// a[i][j] = input;
// }
// }
//
// for (int i = 0; i < 8; i++) {
// for (int j = 0; j < 8; j++) {
// if (a[i][j] == 'F' && i % 2 == 0 && j % 2 == 0) {
// count++;
// }
// else if(a[i][j] == 'F' && i % 2 == 1 && j % 2 == 1) {
// count++;
// }
// }
// }
// printf("%d",count);
//}
int main() {
char t;
int r = 0;
for (int i = 0; i < 64;) {
scanf("%c", &t);
if (t == 'F'&&i % 2 == (i / 8) % 2) r++;
if (t == 'F' || t == '.') i++;
}
printf("%d", r);
}