CodeForces 7A - Kalevitch and Chess
2015-08-26 23:26
351 查看
数学题,计算画几次能画出要求的图形。
#include <iostream> #include <cstdio> #include <cmath> #include <cstdlib> #include <iomanip> #include <algorithm> #include <cctype> #include <stack> #include <queue> #include <string> #include <cstring> #include <iomanip> #include <set> #include <vector> #include <cstdio> #include <stack> #include <sstream> #include <cstring> #include <map> using namespace std; char arr[9][9]; int main() { for(int i=0;i<8;++i) { for(int j=0;j<8;++j) { cin>>arr[i][j]; } } int res1=0; for(int j=0;j<8;j++) { if(arr[0][j]=='B') { int cnt=0; for(int k=1;k<8;k++) { if(arr[k][j]=='B') cnt++; if(cnt==7) res1++; } } } int res2=0; for(int i=0;i<8;i++) { if(arr[i][0]=='B') { int cnt=0; for(int k=1;k<8;++k) { if(arr[i][k]=='B') cnt++; if(cnt==7) res2++; } } } if(res1+res2==16) cout<<"8"<<endl; else cout<<res1+res2<<endl; return 0; }
相关文章推荐
- 微软Word 2007数学插件 Microsoft Math 提供下载
- 关于C# Math 处理奇进偶不进的实现代码
- JavaScript中的Math.SQRT1_2属性使用简介
- JavaScript Math.ceil() 函数使用介绍
- 与Math.pow 相反的函数使用介绍
- JavaScript中使用指数方法Math.exp()的简介
- JavaScript使用Math.Min返回两个数中较小数的方法
- Ajax获取页面被缓存的解决方法
- JavaScript高级程序设计 阅读笔记(十二) js内置对象Math
- JavaScript中Math对象使用说明
- javascript对象之内置对象Math使用方法
- 基于java math API 的详细解释说明
- 简介JavaScript中用于处理正切的Math.tan()方法
- 浅谈JavaScript中的Math.atan()方法的使用
- PHP内置的Math函数效率测试
- 在JavaScript中使用对数Math.log()方法的教程
- JavaScript中用于四舍五入的Math.round()方法讲解
- 简介JavaScript中Math.LOG10E属性的使用
- 在PHP模板引擎smarty生成随机数的方法和math函数详解
- JavaScript中反正弦函数Math.asin()的使用简介