From d986fc07efbc986d1f1c9e7d57813489d15988ad Mon Sep 17 00:00:00 2001 From: KiritoTRw <3021577574@qq.com> Date: Wed, 27 Apr 2016 20:38:33 +0800 Subject: [PATCH] From http://blog.csdn.net/qq_33765907/article/details/51228610 --- ZOJ/3944_csdn.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 ZOJ/3944_csdn.cpp diff --git a/ZOJ/3944_csdn.cpp b/ZOJ/3944_csdn.cpp new file mode 100644 index 0000000..7a7d10c --- /dev/null +++ b/ZOJ/3944_csdn.cpp @@ -0,0 +1,22 @@ +#include +using namespace std; +const int MAXN = 200; +char s[MAXN][MAXN]; + +int main() { + int T; scanf("%d", &T); + for (int cas = 1; cas <= T; ++cas) { + int n, m; scanf("%d%d", &n, &m); + memset(s, 0, sizeof(s)); + for (int i = 0; i < n; ++i) scanf("%s", s[i + 10] + 10); + int ret = 0; + for (int i = 0; i < n + 10; ++i) { + for (int j = 0; j < m + 10; ++j) { + ret += s[i][j + 1] == 'O' || s[i + 1][j] == '/' || s[i + 1][j + 1] == '|' || + s[i + 1][j + 2] == '\\' || s[i + 2][j] == '(' || s[i + 2][j + 2] == ')'; + } + } + cout << ret << endl; + } + return 0; +}