UVA1641ASCIIArea

来源:互联网 发布:js脚本怎么写 编辑:程序博客网 时间:2024/06/03 08:32
//UVA1641ASCIIArea#include<cstdio>#include<cstring>char s[100 + 10];int main() {int h, w;freopen("UVA1641out.txt", "w", stdout);while(scanf("%d%d", &h, &w) == 2) {    int in = 0, c = 0, ans = 0;while(h--) {scanf("%s", s);for(int i = 0; s[i]; i++) {if(s[i] == '/' || s[i] == '\\') {c++; in = !in;}else if(in) ans++;}}printf("%d\n", ans + c / 2);}return 0;}/*4 4/\/\\../.\.\..\/*/

原创粉丝点击